Ext.XTemplate.from=function(el){
	el=Ext.getDom(el);
	return new Ext.XTemplate(el.value||el.innerHTML);};
Ext.util.CSS=function(){
	var rules=null;
	var doc=document;
	var camelRe=/(-[a-z])/gi;
	var camelFn=function(m,a){return a.charAt(1).toUpperCase();};
return{
createStyleSheet:function(cssText,id){
	 var ss;
	 var head=doc.getElementsByTagName("head")[0];
	 var rules=doc.createElement("style");
	 rules.setAttribute("type","text/css");
	 if(id){
		 rules.setAttribute("id",id);
	}
	 if(Ext.isIE){
		 head.appendChild(rules);
		 ss=rules.styleSheet;
		 ss.cssText=cssText;
	}else{
		 try{
				rules.appendChild(doc.createTextNode(cssText));
		}catch(e){
			 rules.cssText=cssText;
		}
		 head.appendChild(rules);
		 ss=rules.styleSheet?rules.styleSheet:(rules.sheet||doc.styleSheets[doc.styleSheets.length-1]);
	}
	 this.cacheStyleSheet(ss);
	 return ss;},
removeStyleSheet:function(id){
	 var existing=doc.getElementById(id);
	 if(existing){
		 existing.parentNode.removeChild(existing);
	}},
swapStyleSheet:function(id,url){
	 this.removeStyleSheet(id);
	 var ss=doc.createElement("link");
	 ss.setAttribute("rel","stylesheet");
	 ss.setAttribute("type","text/css");
	 ss.setAttribute("id",id);
	 ss.setAttribute("href",url);
	 doc.getElementsByTagName("head")[0].appendChild(ss);},
refreshCache:function(){
	 return this.getRules(true);},
cacheStyleSheet:function(ss){
	 if(!rules){
		 rules={};
	}
	 try{
		 var ssRules=ss.cssRules||ss.rules;
		 for(var j=ssRules.length-1;j>=0;--j){
			 rules[ssRules[j].selectorText]=ssRules[j];
		}
	}catch(e){}},
getRules:function(refreshCache){
		if(rules===null||refreshCache){
			rules={};
			var ds=doc.styleSheets;
			for(var i=0,len=ds.length;i<len;i++){
				try{
					this.cacheStyleSheet(ds[i]);
				}catch(e){}
			}
		}
		return rules;
	},
getRule:function(selector,refreshCache){
		var rs=this.getRules(refreshCache);
		if(!Ext.isArray(selector)){
			return rs[selector];
		}
		for(var i=0;i<selector.length;i++){
			if(rs[selector[i]]){
				return rs[selector[i]];
			}
		}
		return null;
	},
updateRule:function(selector,property,value){
		if(!Ext.isArray(selector)){
			var rule=this.getRule(selector);
			if(rule){
				rule.style[property.replace(camelRe,camelFn)]=value;
				return true;
			}
		}else{
			for(var i=0;i<selector.length;i++){
				if(this.updateRule(selector[i],property,value)){
					return true;
				}
			}
		}
		return false;
	}};}();
Ext.util.ClickRepeater=function(el,config)
{
	this.el=Ext.get(el);
	this.el.unselectable();
	Ext.apply(this,config);
	this.addEvents(
		"mousedown",
		"click",
		"mouseup"
	);
	if(!this.disabled){
		this.disabled=true;
		this.enable();
	}
	if(this.handler){
		this.on("click",this.handler,this.scope||this);
	}
	Ext.util.ClickRepeater.superclass.constructor.call(this);};
Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{
	interval:20,
	delay:250,
	preventDefault:true,
	stopDefault:false,
	timer:0,
	enable:function(){
		if(this.disabled){
			this.el.on('mousedown',this.handleMouseDown,this);
			if(this.preventDefault||this.stopDefault){
				this.el.on('click',this.eventOptions,this);
			}
		}
		this.disabled=false;
	},
	disable:function(force){
		if(force||!this.disabled){
			clearTimeout(this.timer);
			if(this.pressClass){
				this.el.removeClass(this.pressClass);
			}
			Ext.getDoc().un('mouseup',this.handleMouseUp,this);
			this.el.removeAllListeners();
		}
		this.disabled=true;
	},
	setDisabled:function(disabled){
		this[disabled?'disable':'enable']();
	},
	eventOptions:function(e){
		if(this.preventDefault){
			e.preventDefault();
		}
		if(this.stopDefault){
			e.stopEvent();
		}
	},
	destroy:function(){
		this.disable(true);
		Ext.destroy(this.el);
		this.purgeListeners();
	},
	handleMouseDown:function(){
		clearTimeout(this.timer);
		this.el.blur();
		if(this.pressClass){
			this.el.addClass(this.pressClass);
		}
		this.mousedownTime=new Date();
		Ext.getDoc().on("mouseup",this.handleMouseUp,this);
		this.el.on("mouseout",this.handleMouseOut,this);
		this.fireEvent("mousedown",this);
		this.fireEvent("click",this);
		if(this.accelerate){
			this.delay=400;
		}
		this.timer=this.click.defer(this.delay||this.interval,this);
	},
	click:function(){
		this.fireEvent("click",this);
		this.timer=this.click.defer(this.accelerate?
			this.easeOutExpo(this.mousedownTime.getElapsed(),
				400,
				-390,
				12000):
			this.interval,this);
	},
	easeOutExpo:function(t,b,c,d){
		return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;
	},
	handleMouseOut:function(){
		clearTimeout(this.timer);
		if(this.pressClass){
			this.el.removeClass(this.pressClass);
		}
		this.el.on("mouseover",this.handleMouseReturn,this);
	},
	handleMouseReturn:function(){
		this.el.un("mouseover",this.handleMouseReturn,this);
		if(this.pressClass){
			this.el.addClass(this.pressClass);
		}
		this.click();
	},
	handleMouseUp:function(){
		clearTimeout(this.timer);
		this.el.un("mouseover",this.handleMouseReturn,this);
		this.el.un("mouseout",this.handleMouseOut,this);
		Ext.getDoc().un("mouseup",this.handleMouseUp,this);
		this.el.removeClass(this.pressClass);
		this.fireEvent("mouseup",this);
	}});
Ext.KeyNav=function(el,config){
	this.el=Ext.get(el);
	Ext.apply(this,config);
	if(!this.disabled){
		this.disabled=true;
		this.enable();
	}};
Ext.KeyNav.prototype={
	disabled:false,
	defaultEventAction:"stopEvent",
	forceKeyDown:false,
	prepareEvent:function(e){
		var k=e.getKey();
		var h=this.keyToHandler[k];
		if(Ext.isSafari2&&h&&k>=37&&k<=40){
			e.stopEvent();
		}
	},
	relay:function(e){
		var k=e.getKey();
		var h=this.keyToHandler[k];
		if(h&&this[h]){
			if(this.doRelay(e,this[h],h)!==true){
				e[this.defaultEventAction]();
			}
		}
	},
	doRelay:function(e,h,hname){
		return h.call(this.scope||this,e);
	},
	enter:false,
	left:false,
	right:false,
	up:false,
	down:false,
	tab:false,
	esc:false,
	pageUp:false,
	pageDown:false,
	del:false,
	home:false,
	end:false,
	keyToHandler:{
		37:"left",
		39:"right",
		38:"up",
		40:"down",
		33:"pageUp",
		34:"pageDown",
		46:"del",
		36:"home",
		35:"end",
		13:"enter",
		27:"esc",
		9:"tab"
	},
	enable:function(){
		if(this.disabled){
			if(this.isKeydown()){
				this.el.on("keydown",this.relay,this);
			}else{
				this.el.on("keydown",this.prepareEvent,this);
				this.el.on("keypress",this.relay,this);
			}
			this.disabled=false;
		}
	},
	disable:function(){
		if(!this.disabled){
			if(this.isKeydown()){
				this.el.un("keydown",this.relay,this);
			}else{
				this.el.un("keydown",this.prepareEvent,this);
				this.el.un("keypress",this.relay,this);
			}
			this.disabled=true;
		}
	},
	setDisabled:function(disabled){
		this[disabled?"disable":"enable"]();
	},
	isKeydown:function(){
		return this.forceKeyDown||Ext.EventManager.useKeydown;
	}};
Ext.KeyMap=function(el,config,eventName){
	this.el=Ext.get(el);
	this.eventName=eventName||"keydown";
	this.bindings=[];
	if(config){
		this.addBinding(config);
	}
	this.enable();};
Ext.KeyMap.prototype={
	stopEvent:false,
	addBinding:function(config){
		if(Ext.isArray(config)){
			Ext.each(config,function(c){
				this.addBinding(c);
			},this);
			return;
		}
		var keyCode=config.key,
			fn=config.fn||config.handler,
			scope=config.scope;
	if(config.stopEvent){
		this.stopEvent=config.stopEvent;
	}
		if(typeof keyCode=="string"){
			var ks=[];
			var keyString=keyCode.toUpperCase();
			for(var j=0,len=keyString.length;j<len;j++){
				ks.push(keyString.charCodeAt(j));
			}
			keyCode=ks;
		}
		var keyArray=Ext.isArray(keyCode);
		var handler=function(e){
			if(this.checkModifiers(config,e)){
				var k=e.getKey();
				if(keyArray){
					for(var i=0,len=keyCode.length;i<len;i++){
						if(keyCode[i]==k){
						 if(this.stopEvent){
							 e.stopEvent();
						}
						 fn.call(scope||window,k,e);
						 return;
						}
					}
				}else{
					if(k==keyCode){
						if(this.stopEvent){
						 e.stopEvent();
						}
						fn.call(scope||window,k,e);
					}
				}
			}
		};
		this.bindings.push(handler);
	},
	checkModifiers:function(config,e){
		var val,key,keys=['shift','ctrl','alt'];
		for(var i=0,len=keys.length;i<len;++i){
			key=keys[i];
			val=config[key];
			if(!(val===undefined||(val===e[key+'Key']))){
				return false;
			}
		}
		return true;
	},
	on:function(key,fn,scope){
		var keyCode,shift,ctrl,alt;
		if(typeof key=="object"&&!Ext.isArray(key)){
			keyCode=key.key;
			shift=key.shift;
			ctrl=key.ctrl;
			alt=key.alt;
		}else{
			keyCode=key;
		}
		this.addBinding({
			key:keyCode,
			shift:shift,
			ctrl:ctrl,
			alt:alt,
			fn:fn,
			scope:scope
		});
	},
	handleKeyDown:function(e){
		if(this.enabled){
			var b=this.bindings;
			for(var i=0,len=b.length;i<len;i++){
				b[i].call(this,e);
			}
		}
	},
	isEnabled:function(){
		return this.enabled;
	},
	enable:function(){
		if(!this.enabled){
			this.el.on(this.eventName,this.handleKeyDown,this);
			this.enabled=true;
		}
	},
	disable:function(){
		if(this.enabled){
			this.el.removeListener(this.eventName,this.handleKeyDown,this);
			this.enabled=false;
		}
	},
	setDisabled:function(disabled){
		this[disabled?"disable":"enable"]();
	}};
Ext.util.TextMetrics=function(){
	var shared;
	return{
		measure:function(el,text,fixedWidth){
			if(!shared){
				shared=Ext.util.TextMetrics.Instance(el,fixedWidth);
			}
			shared.bind(el);
			shared.setFixedWidth(fixedWidth||'auto');
			return shared.getSize(text);
		},
		createInstance:function(el,fixedWidth){
			return Ext.util.TextMetrics.Instance(el,fixedWidth);
		}
	};}();
Ext.util.TextMetrics.Instance=function(bindTo,fixedWidth){
	var ml=new Ext.Element(document.createElement('div'));
	document.body.appendChild(ml.dom);
	ml.position('absolute');
	ml.setLeftTop(-1000,-1000);
	ml.hide();
	if(fixedWidth){
		ml.setWidth(fixedWidth);
	}
	var instance={
		getSize:function(text){
			ml.update(text);
			var s=ml.getSize();
			ml.update('');
			return s;
		},
		bind:function(el){
			ml.setStyle(
				Ext.fly(el).getStyles('font-size','font-style','font-weight','font-family','line-height','text-transform','letter-spacing')
			);
		},
		setFixedWidth:function(width){
			ml.setWidth(width);
		},
		getWidth:function(text){
			ml.dom.style.width='auto';
			return this.getSize(text).width;
		},
		getHeight:function(text){
			return this.getSize(text).height;
		}
	};
	instance.bind(bindTo);
	return instance;};
Ext.Element.addMethods({
	getTextWidth:function(text,min,max){
		return(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width).constrain(min||0,max||1000000);
	}});
Ext.util.Cookies={
	set:function(name,value){
		var argv=arguments;
		var argc=arguments.length;
		var expires=(argc>2)?argv[2]:null;
		var path=(argc>3)?argv[3]:'/';
		var domain=(argc>4)?argv[4]:null;
		var secure=(argc>5)?argv[5]:false;
		document.cookie=name+"="+escape(value)+((expires===null)?"":("; expires="+expires.toGMTString()))+((path===null)?"":("; path="+path))+((domain===null)?"":("; domain="+domain))+((secure===true)?"; secure":"");
	},
	get:function(name){
		var arg=name+"=";
		var alen=arg.length;
		var clen=document.cookie.length;
		var i=0;
		var j=0;
		while(i<clen){
			j=i+alen;
			if(document.cookie.substring(i,j)==arg){
				return Ext.util.Cookies.getCookieVal(j);
			}
			i=document.cookie.indexOf(" ",i)+1;
			if(i===0){
				break;
			}
		}
		return null;
	},
	clear:function(name){
		if(Ext.util.Cookies.get(name)){
			document.cookie=name+"="+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	},
	getCookieVal:function(offset){
		var endstr=document.cookie.indexOf(";",offset);
		if(endstr==-1){
			endstr=document.cookie.length;
		}
		return unescape(document.cookie.substring(offset,endstr));
	}};
Ext.handleError=function(e){
	throw e;};
Ext.Error=function(message){
	this.message=(this.lang[message])?this.lang[message]:message;}
Ext.Error.prototype=new Error();
Ext.apply(Ext.Error.prototype,{
	lang:{},
	name:'Ext.Error',
	getName:function(){
		return this.name;
	},
	getMessage:function(){
		return this.message;
	},
	toJson:function(){
		return Ext.encode(this);
	}});
Ext.ComponentMgr=function(){
	var all=new Ext.util.MixedCollection();
	var types={};
	var ptypes={};
	return{
		register:function(c){
			all.add(c);
		},
		unregister:function(c){
			all.remove(c);
		},
		get:function(id){
			return all.get(id);
		},
		onAvailable:function(id,fn,scope){
			all.on("add",function(index,o){
				if(o.id==id){
					fn.call(scope||o,o);
					all.un("add",fn,scope);
				}
			});
		},
		all:all,
		isRegistered:function(xtype){
			return types[xtype]!==undefined;
		},
		registerType:function(xtype,cls){
			types[xtype]=cls;
			cls.xtype=xtype;
		},
		create:function(config,defaultType){
			return config.render?config:new types[config.xtype||defaultType](config);
		},
		registerPlugin:function(ptype,cls){
			ptypes[ptype]=cls;
			cls.ptype=ptype;
		},
		createPlugin:function(config,defaultType){
			return new ptypes[config.ptype||defaultType](config);
		}
	};}();
Ext.reg=Ext.ComponentMgr.registerType;
Ext.preg=Ext.ComponentMgr.registerPlugin;
Ext.create=Ext.ComponentMgr.create;
Ext.Component=function(config){
	config=config||{};
	if(config.initialConfig){
		if(config.isAction){
			this.baseAction=config;
		}
		config=config.initialConfig;
	}else if(config.tagName||config.dom||Ext.isString(config)){
		config={applyTo:config,id:config.id||config};
	}
	this.initialConfig=config;
	Ext.apply(this,config);
	this.addEvents(
		'disable',
		'enable',
		'beforeshow',
		'show',
		'beforehide',
		'hide',
		'beforerender',
		'render',
		'afterrender',
		'beforedestroy',
		'destroy',
		'beforestaterestore',
		'staterestore',
		'beforestatesave',
		'statesave'
	);
	this.getId();
	Ext.ComponentMgr.register(this);
	Ext.Component.superclass.constructor.call(this);
	if(this.baseAction){
		this.baseAction.addComponent(this);
	}
	this.initComponent();
	if(this.plugins){
		if(Ext.isArray(this.plugins)){
			for(var i=0,len=this.plugins.length;i<len;i++){
				this.plugins[i]=this.initPlugin(this.plugins[i]);
			}
		}else{
			this.plugins=this.initPlugin(this.plugins);
		}
	}
	if(this.stateful!==false){
		this.initState(config);
	}
	if(this.applyTo){
		this.applyToMarkup(this.applyTo);
		delete this.applyTo;
	}else if(this.renderTo){
		this.render(this.renderTo);
		delete this.renderTo;
	}};
Ext.Component.AUTO_ID=1000;
Ext.extend(Ext.Component,Ext.util.Observable,{
	disabled:false,
	hidden:false,
	autoEl:'div',
	disabledClass:'x-item-disabled',
	allowDomMove:true,
	autoShow:false,
	hideMode:'display',
	hideParent:false,
	rendered:false,
	ctype:'Ext.Component',
	actionMode:'el',
	getActionEl:function(){
		return this[this.actionMode];
	},
	initPlugin:function(p){
		if(p.ptype&&!Ext.isFunction(p.init)){
			p=Ext.ComponentMgr.createPlugin(p);
		}else if(Ext.isString(p)){
			p=Ext.ComponentMgr.createPlugin({
				ptype:p
			});
		}
		p.init(this);
		return p;
	},
	initComponent:Ext.emptyFn,
	render:function(container,position){
		if(!this.rendered&&this.fireEvent('beforerender',this)!==false){
			if(!container&&this.el){
				this.el=Ext.get(this.el);
				container=this.el.dom.parentNode;
				this.allowDomMove=false;
			}
			this.container=Ext.get(container);
			if(this.ctCls){
				this.container.addClass(this.ctCls);
			}
			this.rendered=true;
			if(position!==undefined){
				if(Ext.isNumber(position)){
					position=this.container.dom.childNodes[position];
				}else{
					position=Ext.getDom(position);
				}
			}
			this.onRender(this.container,position||null);
			if(this.autoShow){
				this.el.removeClass(['x-hidden','x-hide-'+this.hideMode]);
			}
			if(this.cls){
				this.el.addClass(this.cls);
				delete this.cls;
			}
			if(this.style){
				this.el.applyStyles(this.style);
				delete this.style;
			}
			if(this.overCls){
				this.el.addClassOnOver(this.overCls);
			}
			this.fireEvent('render',this);
			this.afterRender(this.container);
			if(this.hidden){
				this.doHide();
			}
			if(this.disabled){
				this.disable(true);
			}
			if(this.stateful!==false){
				this.initStateEvents();
			}
			this.initRef();
			this.fireEvent('afterrender',this);
		}
		return this;
	},
	initRef:function(){
		if(this.ref){
			var levels=this.ref.split('/');
			var last=levels.length,i=0;
			var t=this;
			while(i<last){
				if(t.ownerCt){
					t=t.ownerCt;
				}
				i++;
			}
			t[levels[--i]]=this;
		}
	},
	initState:function(config){
		if(Ext.state.Manager){
			var id=this.getStateId();
			if(id){
				var state=Ext.state.Manager.get(id);
				if(state){
					if(this.fireEvent('beforestaterestore',this,state)!==false){
						this.applyState(state);
						this.fireEvent('staterestore',this,state);
					}
				}
			}
		}
	},
	getStateId:function(){
		return this.stateId||((this.id.indexOf('ext-comp-')==0||this.id.indexOf('ext-gen')==0)?null:this.id);
	},
	initStateEvents:function(){
		if(this.stateEvents){
			for(var i=0,e;e=this.stateEvents[i];i++){
				this.on(e,this.saveState,this,{delay:100});
			}
		}
	},
	applyState:function(state,config){
		if(state){
			Ext.apply(this,state);
		}
	},
	getState:function(){
		return null;
	},
	saveState:function(){
		if(Ext.state.Manager&&this.stateful!==false){
			var id=this.getStateId();
			if(id){
				var state=this.getState();
				if(this.fireEvent('beforestatesave',this,state)!==false){
					Ext.state.Manager.set(id,state);
					this.fireEvent('statesave',this,state);
				}
			}
		}
	},
	applyToMarkup:function(el){
		this.allowDomMove=false;
		this.el=Ext.get(el);
		this.render(this.el.dom.parentNode);
	},
	addClass:function(cls){
		if(this.el){
			this.el.addClass(cls);
		}else{
			this.cls=this.cls?this.cls+' '+cls:cls;
		}
		return this;
	},
	removeClass:function(cls){
		if(this.el){
			this.el.removeClass(cls);
		}else if(this.cls){
			this.cls=this.cls.split(' ').remove(cls).join(' ');
		}
		return this;
	},
	onRender:function(ct,position){
		if(!this.el&&this.autoEl){
			if(Ext.isString(this.autoEl)){
				this.el=document.createElement(this.autoEl);
			}else{
				var div=document.createElement('div');
				Ext.DomHelper.overwrite(div,this.autoEl);
				this.el=div.firstChild;
			}
			if(!this.el.id){
				this.el.id=this.getId();
			}
		}
		if(this.el){
			this.el=Ext.get(this.el);
			if(this.allowDomMove!==false){
				ct.dom.insertBefore(this.el.dom,position);
			}
		}
	},
	getAutoCreate:function(){
		var cfg=Ext.isObject(this.autoCreate)?
					 this.autoCreate:Ext.apply({},this.defaultAutoCreate);
		if(this.id&&!cfg.id){
			cfg.id=this.id;
		}
		return cfg;
	},
	afterRender:Ext.emptyFn,
	destroy:function(){
		if(this.fireEvent('beforedestroy',this)!==false){
			this.beforeDestroy();
			if(this.rendered){
				this.el.removeAllListeners();
				this.el.remove();
				if(this.actionMode=='container'||this.removeMode=='container'){
					this.container.remove();
				}
			}
			this.onDestroy();
			Ext.ComponentMgr.unregister(this);
			this.fireEvent('destroy',this);
			this.purgeListeners();
		}
	},
	beforeDestroy:Ext.emptyFn,
	onDestroy:Ext.emptyFn,
	getEl:function(){
		return this.el;
	},
	getId:function(){
		return this.id||(this.id='ext-comp-'+(++Ext.Component.AUTO_ID));
	},
	getItemId:function(){
		return this.itemId||this.getId();
	},
	focus:function(selectText,delay){
		if(delay){
			this.focus.defer(Ext.isNumber(delay)?delay:10,this,[selectText,false]);
			return;
		}
		if(this.rendered){
			this.el.focus();
			if(selectText===true){
				this.el.dom.select();
			}
		}
		return this;
	},
	blur:function(){
		if(this.rendered){
			this.el.blur();
		}
		return this;
	},
	disable:function(silent){
		if(this.rendered){
			this.onDisable();
		}
		this.disabled=true;
		if(silent!==true){
			this.fireEvent('disable',this);
		}
		return this;
	},
	onDisable:function(){
		this.getActionEl().addClass(this.disabledClass);
		this.el.dom.disabled=true;
	},
	enable:function(){
		if(this.rendered){
			this.onEnable();
		}
		this.disabled=false;
		this.fireEvent('enable',this);
		return this;
	},
	onEnable:function(){
		this.getActionEl().removeClass(this.disabledClass);
		this.el.dom.disabled=false;
	},
	setDisabled:function(disabled){
		return this[disabled?'disable':'enable']();
	},
	show:function(){
		if(this.fireEvent('beforeshow',this)!==false){
			this.hidden=false;
			if(this.autoRender){
				this.render(Ext.isBoolean(this.autoRender)?Ext.getBody():this.autoRender);
			}
			if(this.rendered){
				this.onShow();
			}
			this.fireEvent('show',this);
		}
		return this;
	},
	onShow:function(){
		this.getVisibiltyEl().removeClass('x-hide-'+this.hideMode);
	},
	hide:function(){
		if(this.fireEvent('beforehide',this)!==false){
			this.doHide();
			this.fireEvent('hide',this);
		}
		return this;
	},
	doHide:function(){
		this.hidden=true;
		if(this.rendered){
			this.onHide();
		}
	},
	onHide:function(){
		this.getVisibiltyEl().addClass('x-hide-'+this.hideMode);
	},
	getVisibiltyEl:function(){
		return this.hideParent?this.container:this.getActionEl();
	},
	setVisible:function(visible){
		return this[visible?'show':'hide']();
	},
	isVisible:function(){
		return this.rendered&&this.getVisibiltyEl().isVisible();
	},
	cloneConfig:function(overrides){
		overrides=overrides||{};
		var id=overrides.id||Ext.id();
		var cfg=Ext.applyIf(overrides,this.initialConfig);
		cfg.id=id;
		return new this.constructor(cfg);
	},
	getXType:function(){
		return this.constructor.xtype;
	},
	isXType:function(xtype,shallow){
		if(Ext.isFunction(xtype)){
			xtype=xtype.xtype;
		}else if(Ext.isObject(xtype)){
			xtype=xtype.constructor.xtype;
		}
		return!shallow?('/'+this.getXTypes()+'/').indexOf('/'+xtype+'/')!=-1:this.constructor.xtype==xtype;
	},
	getXTypes:function(){
		var tc=this.constructor;
		if(!tc.xtypes){
			var c=[],sc=this;
			while(sc&&sc.constructor.xtype){
				c.unshift(sc.constructor.xtype);
				sc=sc.constructor.superclass;
			}
			tc.xtypeChain=c;
			tc.xtypes=c.join('/');
		}
		return tc.xtypes;
	},
	findParentBy:function(fn){
		for(var p=this.ownerCt;(p!=null)&&!fn(p,this);p=p.ownerCt);
		return p||null;
	},
	findParentByType:function(xtype){
		return Ext.isFunction(xtype)?
			this.findParentBy(function(p){
				return p.constructor===xtype;
			}):
			this.findParentBy(function(p){
				return p.constructor.xtype===xtype;
			});
	},
	getDomPositionEl:function(){
		return this.getPositionEl?this.getPositionEl():this.getEl();
	},
	purgeListeners:function(){
		Ext.Component.superclass.purgeListeners.call(this);
		if(this.mons){
			this.on('beforedestroy',this.clearMons,this,{single:true});
		}
	},
	clearMons:function(){
		Ext.each(this.mons,function(m){
			m.item.un(m.ename,m.fn,m.scope);
		},this);
		this.mons=[];
	},
	mon:function(item,ename,fn,scope,opt){
		if(!this.mons){
			this.mons=[];
			this.on('beforedestroy',this.clearMons,this,{single:true});
		}
		if(Ext.isObject(ename)){
			var propRe=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
			var o=ename;
			for(var e in o){
				if(propRe.test(e)){
					continue;
				}
				if(Ext.isFunction(o[e])){
					this.mons.push({
						item:item,ename:e,fn:o[e],scope:o.scope
					});
					item.on(e,o[e],o.scope,o);
				}else{
					this.mons.push({
						item:item,ename:e,fn:o[e],scope:o.scope
					});
					item.on(e,o[e]);
				}
			}
			return;
		}
		this.mons.push({
			item:item,ename:ename,fn:fn,scope:scope
		});
		item.on(ename,fn,scope,opt);
	},
	mun:function(item,ename,fn,scope){
		var found,mon;
		for(var i=0,len=this.mons.length;i<len;++i){
			mon=this.mons[i];
			if(item===mon.item&&ename==mon.ename&&fn===mon.fn&&scope===mon.scope){
				this.mons.splice(i,1);
				item.un(ename,fn,scope);
				found=true;
				break;
			}
		}
		return found;
	},
	nextSibling:function(){
		if(this.ownerCt){
			var index=this.ownerCt.items.indexOf(this);
			if(index!=-1&&index+1<this.ownerCt.items.getCount()){
				return this.ownerCt.items.itemAt(index+1);
			}
		}
		return null;
	},
	previousSibling:function(){
		if(this.ownerCt){
			var index=this.ownerCt.items.indexOf(this);
			if(index>0){
				return this.ownerCt.items.itemAt(index-1);
			}
		}
		return null;
	},
	getBubbleTarget:function(){
		return this.ownerCt;
	}});
Ext.reg('component',Ext.Component);
Ext.Action=function(config){
	this.initialConfig=config;
	this.itemId=config.itemId=(config.itemId||config.id||Ext.id());
	this.items=[];}
Ext.Action.prototype={
	isAction:true,
	setText:function(text){
		this.initialConfig.text=text;
		this.callEach('setText',[text]);
	},
	getText:function(){
		return this.initialConfig.text;
	},
	setIconClass:function(cls){
		this.initialConfig.iconCls=cls;
		this.callEach('setIconClass',[cls]);
	},
	getIconClass:function(){
		return this.initialConfig.iconCls;
	},
	setDisabled:function(v){
		this.initialConfig.disabled=v;
		this.callEach('setDisabled',[v]);
	},
	enable:function(){
		this.setDisabled(false);
	},
	disable:function(){
		this.setDisabled(true);
	},
	isDisabled:function(){
		return this.initialConfig.disabled;
	},
	setHidden:function(v){
		this.initialConfig.hidden=v;
		this.callEach('setVisible',[!v]);
	},
	show:function(){
		this.setHidden(false);
	},
	hide:function(){
		this.setHidden(true);
	},
	isHidden:function(){
		return this.initialConfig.hidden;
	},
	setHandler:function(fn,scope){
		this.initialConfig.handler=fn;
		this.initialConfig.scope=scope;
		this.callEach('setHandler',[fn,scope]);
	},
	each:function(fn,scope){
		Ext.each(this.items,fn,scope);
	},
	callEach:function(fnName,args){
		var cs=this.items;
		for(var i=0,len=cs.length;i<len;i++){
			cs[i][fnName].apply(cs[i],args);
		}
	},
	addComponent:function(comp){
		this.items.push(comp);
		comp.on('destroy',this.removeComponent,this);
	},
	removeComponent:function(comp){
		this.items.remove(comp);
	},
	execute:function(){
		this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments);
	}};
(function(){
Ext.Layer=function(config,existingEl){
	config=config||{};
	var dh=Ext.DomHelper;
	var cp=config.parentEl,pel=cp?Ext.getDom(cp):document.body;
	if(existingEl){
		this.dom=Ext.getDom(existingEl);
	}
	if(!this.dom){
		var o=config.dh||{tag:'div',cls:'x-layer'};
		this.dom=dh.append(pel,o);
	}
	if(config.cls){
		this.addClass(config.cls);
	}
	this.constrain=config.constrain!==false;
	this.setVisibilityMode(Ext.Element.VISIBILITY);
	if(config.id){
		this.id=this.dom.id=config.id;
	}else{
		this.id=Ext.id(this.dom);
	}
	this.zindex=config.zindex||this.getZIndex();
	this.position('absolute',this.zindex);
	if(config.shadow){
		this.shadowOffset=config.shadowOffset||4;
		this.shadow=new Ext.Shadow({
			offset:this.shadowOffset,
			mode:config.shadow
		});
	}else{
		this.shadowOffset=0;
	}
	this.useShim=config.shim!==false&&Ext.useShims;
	this.useDisplay=config.useDisplay;
	this.hide();};
var supr=Ext.Element.prototype;
var shims=[];
Ext.extend(Ext.Layer,Ext.Element,{
	getZIndex:function(){
		return this.zindex||parseInt((this.getShim()||this).getStyle('z-index'),10)||11000;
	},
	getShim:function(){
		if(!this.useShim){
			return null;
		}
		if(this.shim){
			return this.shim;
		}
		var shim=shims.shift();
		if(!shim){
			shim=this.createShim();
			shim.enableDisplayMode('block');
			shim.dom.style.display='none';
			shim.dom.style.visibility='visible';
		}
		var pn=this.dom.parentNode;
		if(shim.dom.parentNode!=pn){
			pn.insertBefore(shim.dom,this.dom);
		}
		shim.setStyle('z-index',this.getZIndex()-2);
		this.shim=shim;
		return shim;
	},
	hideShim:function(){
		if(this.shim){
			this.shim.setDisplayed(false);
			shims.push(this.shim);
			delete this.shim;
		}
	},
	disableShadow:function(){
		if(this.shadow){
			this.shadowDisabled=true;
			this.shadow.hide();
			this.lastShadowOffset=this.shadowOffset;
			this.shadowOffset=0;
		}
	},
	enableShadow:function(show){
		if(this.shadow){
			this.shadowDisabled=false;
			this.shadowOffset=this.lastShadowOffset;
			delete this.lastShadowOffset;
			if(show){
				this.sync(true);
			}
		}
	},
	sync:function(doShow){
		var sw=this.shadow;
		if(!this.updating&&this.isVisible()&&(sw||this.useShim)){
			var sh=this.getShim();
			var w=this.getWidth(),
				h=this.getHeight();
			var l=this.getLeft(true),
				t=this.getTop(true);
			if(sw&&!this.shadowDisabled){
				if(doShow&&!sw.isVisible()){
					sw.show(this);
				}else{
					sw.realign(l,t,w,h);
				}
				if(sh){
					if(doShow){
					 sh.show();
					}
					var a=sw.adjusts,s=sh.dom.style;
					s.left=(Math.min(l,l+a.l))+'px';
					s.top=(Math.min(t,t+a.t))+'px';
					s.width=(w+a.w)+'px';
					s.height=(h+a.h)+'px';
				}
			}else if(sh){
				if(doShow){
				 sh.show();
				}
				sh.setSize(w,h);
				sh.setLeftTop(l,t);
			}
		}
	},
	destroy:function(){
		this.hideShim();
		if(this.shadow){
			this.shadow.hide();
		}
		this.removeAllListeners();
		Ext.removeNode(this.dom);
		Ext.Element.uncache(this.id);
	},
	remove:function(){
		this.destroy();
	},
	beginUpdate:function(){
		this.updating=true;
	},
	endUpdate:function(){
		this.updating=false;
		this.sync(true);
	},
	hideUnders:function(negOffset){
		if(this.shadow){
			this.shadow.hide();
		}
		this.hideShim();
	},
	constrainXY:function(){
		if(this.constrain){
			var vw=Ext.lib.Dom.getViewWidth(),
				vh=Ext.lib.Dom.getViewHeight();
			var s=Ext.getDoc().getScroll();
			var xy=this.getXY();
			var x=xy[0],y=xy[1];
			var so=this.shadowOffset;
			var w=this.dom.offsetWidth+so,h=this.dom.offsetHeight+so;
			var moved=false;
			if((x+w)>vw+s.left){
				x=vw-w-so;
				moved=true;
			}
			if((y+h)>vh+s.top){
				y=vh-h-so;
				moved=true;
			}
			if(x<s.left){
				x=s.left;
				moved=true;
			}
			if(y<s.top){
				y=s.top;
				moved=true;
			}
			if(moved){
				if(this.avoidY){
					var ay=this.avoidY;
					if(y<=ay&&(y+h)>=ay){
						y=ay-h-5;
					}
				}
				xy=[x,y];
				this.storeXY(xy);
				supr.setXY.call(this,xy);
				this.sync();
			}
		}
		return this;
	},
	isVisible:function(){
		return this.visible;
	},
	showAction:function(){
		this.visible=true;
		if(this.useDisplay===true){
			this.setDisplayed('');
		}else if(this.lastXY){
			supr.setXY.call(this,this.lastXY);
		}else if(this.lastLT){
			supr.setLeftTop.call(this,this.lastLT[0],this.lastLT[1]);
		}
	},
	hideAction:function(){
		this.visible=false;
		if(this.useDisplay===true){
			this.setDisplayed(false);
		}else{
			this.setLeftTop(-10000,-10000);
		}
	},
	setVisible:function(v,a,d,c,e){
		if(v){
			this.showAction();
		}
		if(a&&v){
			var cb=function(){
				this.sync(true);
				if(c){
					c();
				}
			}.createDelegate(this);
			supr.setVisible.call(this,true,true,d,cb,e);
		}else{
			if(!v){
				this.hideUnders(true);
			}
			var cb=c;
			if(a){
				cb=function(){
					this.hideAction();
					if(c){
						c();
					}
				}.createDelegate(this);
			}
			supr.setVisible.call(this,v,a,d,cb,e);
			if(v){
				this.sync(true);
			}else if(!a){
				this.hideAction();
			}
		}
		return this;
	},
	storeXY:function(xy){
		delete this.lastLT;
		this.lastXY=xy;
	},
	storeLeftTop:function(left,top){
		delete this.lastXY;
		this.lastLT=[left,top];
	},
	beforeFx:function(){
		this.beforeAction();
		return Ext.Layer.superclass.beforeFx.apply(this,arguments);
	},
	afterFx:function(){
		Ext.Layer.superclass.afterFx.apply(this,arguments);
		this.sync(this.isVisible());
	},
	beforeAction:function(){
		if(!this.updating&&this.shadow){
			this.shadow.hide();
		}
	},
	setLeft:function(left){
		this.storeLeftTop(left,this.getTop(true));
		supr.setLeft.apply(this,arguments);
		this.sync();
		return this;
	},
	setTop:function(top){
		this.storeLeftTop(this.getLeft(true),top);
		supr.setTop.apply(this,arguments);
		this.sync();
		return this;
	},
	setLeftTop:function(left,top){
		this.storeLeftTop(left,top);
		supr.setLeftTop.apply(this,arguments);
		this.sync();
		return this;
	},
	setXY:function(xy,a,d,c,e){
		this.fixDisplay();
		this.beforeAction();
		this.storeXY(xy);
		var cb=this.createCB(c);
		supr.setXY.call(this,xy,a,d,cb,e);
		if(!a){
			cb();
		}
		return this;
	},
	createCB:function(c){
		var el=this;
		return function(){
			el.constrainXY();
			el.sync(true);
			if(c){
				c();
			}
		};
	},
	setX:function(x,a,d,c,e){
		this.setXY([x,this.getY()],a,d,c,e);
		return this;
	},
	setY:function(y,a,d,c,e){
		this.setXY([this.getX(),y],a,d,c,e);
		return this;
	},
	setSize:function(w,h,a,d,c,e){
		this.beforeAction();
		var cb=this.createCB(c);
		supr.setSize.call(this,w,h,a,d,cb,e);
		if(!a){
			cb();
		}
		return this;
	},
	setWidth:function(w,a,d,c,e){
		this.beforeAction();
		var cb=this.createCB(c);
		supr.setWidth.call(this,w,a,d,cb,e);
		if(!a){
			cb();
		}
		return this;
	},
	setHeight:function(h,a,d,c,e){
		this.beforeAction();
		var cb=this.createCB(c);
		supr.setHeight.call(this,h,a,d,cb,e);
		if(!a){
			cb();
		}
		return this;
	},
	setBounds:function(x,y,w,h,a,d,c,e){
		this.beforeAction();
		var cb=this.createCB(c);
		if(!a){
			this.storeXY([x,y]);
			supr.setXY.call(this,[x,y]);
			supr.setSize.call(this,w,h,a,d,cb,e);
			cb();
		}else{
			supr.setBounds.call(this,x,y,w,h,a,d,cb,e);
		}
		return this;
	},
	setZIndex:function(zindex){
		this.zindex=zindex;
		this.setStyle('z-index',zindex+2);
		if(this.shadow){
			this.shadow.setZIndex(zindex+1);
		}
		if(this.shim){
			this.shim.setStyle('z-index',zindex);
		}
		return this;
	}});})();
Ext.Shadow=function(config){
	Ext.apply(this,config);
	if(typeof this.mode!="string"){
		this.mode=this.defaultMode;
	}
	var o=this.offset,a={h:0};
	var rad=Math.floor(this.offset/2);
	switch(this.mode.toLowerCase()){
		case"drop":
			a.w=0;
			a.l=a.t=o;
			a.t-=1;
			if(Ext.isIE){
				a.l-=this.offset+rad;
				a.t-=this.offset+rad;
				a.w-=rad;
				a.h-=rad;
				a.t+=1;
			}
		break;
		case"sides":
			a.w=(o*2);
			a.l=-o;
			a.t=o-1;
			if(Ext.isIE){
				a.l-=(this.offset-rad);
				a.t-=this.offset+rad;
				a.l+=1;
				a.w-=(this.offset-rad)*2;
				a.w-=rad+1;
				a.h-=1;
			}
		break;
		case"frame":
			a.w=a.h=(o*2);
			a.l=a.t=-o;
			a.t+=1;
			a.h-=2;
			if(Ext.isIE){
				a.l-=(this.offset-rad);
				a.t-=(this.offset-rad);
				a.l+=1;
				a.w-=(this.offset+rad+1);
				a.h-=(this.offset+rad);
				a.h+=1;
			}
		break;
	};
	this.adjusts=a;};
Ext.Shadow.prototype={
	offset:4,
	defaultMode:"drop",
	show:function(target){
		target=Ext.get(target);
		if(!this.el){
			this.el=Ext.Shadow.Pool.pull();
			if(this.el.dom.nextSibling!=target.dom){
				this.el.insertBefore(target);
			}
		}
		this.el.setStyle("z-index",this.zIndex||parseInt(target.getStyle("z-index"),10)-1);
		if(Ext.isIE){
			this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";
		}
		this.realign(
			target.getLeft(true),
			target.getTop(true),
			target.getWidth(),
			target.getHeight()
		);
		this.el.dom.style.display="block";
	},
	isVisible:function(){
		return this.el?true:false;
	},
	realign:function(l,t,w,h){
		if(!this.el){
			return;
		}
		var a=this.adjusts,d=this.el.dom,s=d.style;
		var iea=0;
		s.left=(l+a.l)+"px";
		s.top=(t+a.t)+"px";
		var sw=(w+a.w),sh=(h+a.h),sws=sw+"px",shs=sh+"px";
		if(s.width!=sws||s.height!=shs){
			s.width=sws;
			s.height=shs;
			if(!Ext.isIE){
				var cn=d.childNodes;
				var sww=Math.max(0,(sw-12))+"px";
				cn[0].childNodes[1].style.width=sww;
				cn[1].childNodes[1].style.width=sww;
				cn[2].childNodes[1].style.width=sww;
				cn[1].style.height=Math.max(0,(sh-12))+"px";
			}
		}
	},
	hide:function(){
		if(this.el){
			this.el.dom.style.display="none";
			Ext.Shadow.Pool.push(this.el);
			delete this.el;
		}
	},
	setZIndex:function(z){
		this.zIndex=z;
		if(this.el){
			this.el.setStyle("z-index",z);
		}
	}};
Ext.Shadow.Pool=function(){
	var p=[];
	var markup=Ext.isIE?
				'<div class="x-ie-shadow"></div>':
				'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
	return{
		pull:function(){
			var sh=p.shift();
			if(!sh){
				sh=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,markup));
				sh.autoBoxAdjust=false;
			}
			return sh;
		},
		push:function(sh){
			p.push(sh);
		}
	};}();
Ext.BoxComponent=Ext.extend(Ext.Component,{
	initComponent:function(){
		Ext.BoxComponent.superclass.initComponent.call(this);
		this.addEvents(
			'resize',
			'move'
		);
	},
	boxReady:false,
	deferHeight:false,
	setSize:function(w,h){
		if(typeof w=='object'){
			h=w.height;
			w=w.width;
		}
		if(!this.boxReady){
			this.width=w;
			this.height=h;
			return this;
		}
		if(this.cacheSizes!==false&&this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){
			return this;
		}
		this.lastSize={width:w,height:h};
		var adj=this.adjustSize(w,h);
		var aw=adj.width,ah=adj.height;
		if(aw!==undefined||ah!==undefined){
			var rz=this.getResizeEl();
			if(!this.deferHeight&&aw!==undefined&&ah!==undefined){
				rz.setSize(aw,ah);
			}else if(!this.deferHeight&&ah!==undefined){
				rz.setHeight(ah);
			}else if(aw!==undefined){
				rz.setWidth(aw);
			}
			this.onResize(aw,ah,w,h);
			this.fireEvent('resize',this,aw,ah,w,h);
		}
		return this;
	},
	setWidth:function(width){
		return this.setSize(width);
	},
	setHeight:function(height){
		return this.setSize(undefined,height);
	},
	getSize:function(){
		return this.getResizeEl().getSize();
	},
	getWidth:function(){
		return this.getResizeEl().getWidth();
	},
	getHeight:function(){
		return this.getResizeEl().getHeight();
	},
	getOuterSize:function(){
		var el=this.getResizeEl();
		return{width:el.getWidth()+el.getMargins('lr'),
				height:el.getHeight()+el.getMargins('tb')};
	},
	getPosition:function(local){
		var el=this.getPositionEl();
		if(local===true){
			return[el.getLeft(true),el.getTop(true)];
		}
		return this.xy||el.getXY();
	},
	getBox:function(local){
		var pos=this.getPosition(local);
		var s=this.getSize();
		s.x=pos[0];
		s.y=pos[1];
		return s;
	},
	updateBox:function(box){
		this.setSize(box.width,box.height);
		this.setPagePosition(box.x,box.y);
		return this;
	},
	getResizeEl:function(){
		return this.resizeEl||this.el;
	},
	getPositionEl:function(){
		return this.positionEl||this.el;
	},
	setPosition:function(x,y){
		if(x&&typeof x[1]=='number'){
			y=x[1];
			x=x[0];
		}
		this.x=x;
		this.y=y;
		if(!this.boxReady){
			return this;
		}
		var adj=this.adjustPosition(x,y);
		var ax=adj.x,ay=adj.y;
		var el=this.getPositionEl();
		if(ax!==undefined||ay!==undefined){
			if(ax!==undefined&&ay!==undefined){
				el.setLeftTop(ax,ay);
			}else if(ax!==undefined){
				el.setLeft(ax);
			}else if(ay!==undefined){
				el.setTop(ay);
			}
			this.onPosition(ax,ay);
			this.fireEvent('move',this,ax,ay);
		}
		return this;
	},
	setPagePosition:function(x,y){
		if(x&&typeof x[1]=='number'){
			y=x[1];
			x=x[0];
		}
		this.pageX=x;
		this.pageY=y;
		if(!this.boxReady){
			return;
		}
		if(x===undefined||y===undefined){
			return;
		}
		var p=this.getPositionEl().translatePoints(x,y);
		this.setPosition(p.left,p.top);
		return this;
	},
	onRender:function(ct,position){
		Ext.BoxComponent.superclass.onRender.call(this,ct,position);
		if(this.resizeEl){
			this.resizeEl=Ext.get(this.resizeEl);
		}
		if(this.positionEl){
			this.positionEl=Ext.get(this.positionEl);
		}
	},
	afterRender:function(){
		Ext.BoxComponent.superclass.afterRender.call(this);
		this.boxReady=true;
		this.setSize(this.width,this.height);
		if(this.x||this.y){
			this.setPosition(this.x,this.y);
		}else if(this.pageX||this.pageY){
			this.setPagePosition(this.pageX,this.pageY);
		}
	},
	syncSize:function(){
		delete this.lastSize;
		this.setSize(this.autoWidth?undefined:this.getResizeEl().getWidth(),this.autoHeight?undefined:this.getResizeEl().getHeight());
		return this;
	},
	onResize:function(adjWidth,adjHeight,rawWidth,rawHeight){
	},
	onPosition:function(x,y){
	},
	adjustSize:function(w,h){
		if(this.autoWidth){
			w='auto';
		}
		if(this.autoHeight){
			h='auto';
		}
		return{width:w,height:h};
	},
	adjustPosition:function(x,y){
		return{x:x,y:y};
	}});
Ext.reg('box',Ext.BoxComponent);
Ext.Spacer=Ext.extend(Ext.BoxComponent,{
	autoEl:'div'});
Ext.reg('spacer',Ext.Spacer);
Ext.SplitBar=function(dragElement,resizingElement,orientation,placement,existingProxy){
	this.el=Ext.get(dragElement,true);
	this.el.dom.unselectable="on";
	this.resizingEl=Ext.get(resizingElement,true);
	this.orientation=orientation||Ext.SplitBar.HORIZONTAL;
	this.minSize=0;
	this.maxSize=2000;
	this.animate=false;
	this.useShim=false;
	this.shim=null;
	if(!existingProxy){
		this.proxy=Ext.SplitBar.createProxy(this.orientation);
	}else{
		this.proxy=Ext.get(existingProxy).dom;
	}
	this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});
	this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);
	this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);
	this.dragSpecs={};
	this.adapter=new Ext.SplitBar.BasicLayoutAdapter();
	this.adapter.init(this);
	if(this.orientation==Ext.SplitBar.HORIZONTAL){
		this.placement=placement||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);
		this.el.addClass("x-splitbar-h");
	}else{
		this.placement=placement||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);
		this.el.addClass("x-splitbar-v");
	}
	this.addEvents(
		"resize",
		"moved",
		"beforeresize",
		"beforeapply"
	);
	Ext.SplitBar.superclass.constructor.call(this);};
Ext.extend(Ext.SplitBar,Ext.util.Observable,{
	onStartProxyDrag:function(x,y){
		this.fireEvent("beforeresize",this);
		this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);
		this.overlay.unselectable();
		this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));
		this.overlay.show();
		Ext.get(this.proxy).setDisplayed("block");
		var size=this.adapter.getElementSize(this);
		this.activeMinSize=this.getMinimumSize();
		this.activeMaxSize=this.getMaximumSize();
		var c1=size-this.activeMinSize;
		var c2=Math.max(this.activeMaxSize-size,0);
		if(this.orientation==Ext.SplitBar.HORIZONTAL){
			this.dd.resetConstraints();
			this.dd.setXConstraint(
				this.placement==Ext.SplitBar.LEFT?c1:c2,
				this.placement==Ext.SplitBar.LEFT?c2:c1,
				this.tickSize
			);
			this.dd.setYConstraint(0,0);
		}else{
			this.dd.resetConstraints();
			this.dd.setXConstraint(0,0);
			this.dd.setYConstraint(
				this.placement==Ext.SplitBar.TOP?c1:c2,
				this.placement==Ext.SplitBar.TOP?c2:c1,
				this.tickSize
			);
		}
		this.dragSpecs.startSize=size;
		this.dragSpecs.startPoint=[x,y];
		Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y);
	},
	onEndProxyDrag:function(e){
		Ext.get(this.proxy).setDisplayed(false);
		var endPoint=Ext.lib.Event.getXY(e);
		if(this.overlay){
			Ext.destroy(this.overlay);
			delete this.overlay;
		}
		var newSize;
		if(this.orientation==Ext.SplitBar.HORIZONTAL){
			newSize=this.dragSpecs.startSize+
				(this.placement==Ext.SplitBar.LEFT?
					endPoint[0]-this.dragSpecs.startPoint[0]:
					this.dragSpecs.startPoint[0]-endPoint[0]
				);
		}else{
			newSize=this.dragSpecs.startSize+
				(this.placement==Ext.SplitBar.TOP?
					endPoint[1]-this.dragSpecs.startPoint[1]:
					this.dragSpecs.startPoint[1]-endPoint[1]
				);
		}
		newSize=Math.min(Math.max(newSize,this.activeMinSize),this.activeMaxSize);
		if(newSize!=this.dragSpecs.startSize){
			if(this.fireEvent('beforeapply',this,newSize)!==false){
				this.adapter.setElementSize(this,newSize);
				this.fireEvent("moved",this,newSize);
				this.fireEvent("resize",this,newSize);
			}
		}
	},
	getAdapter:function(){
		return this.adapter;
	},
	setAdapter:function(adapter){
		this.adapter=adapter;
		this.adapter.init(this);
	},
	getMinimumSize:function(){
		return this.minSize;
	},
	setMinimumSize:function(minSize){
		this.minSize=minSize;
	},
	getMaximumSize:function(){
		return this.maxSize;
	},
	setMaximumSize:function(maxSize){
		this.maxSize=maxSize;
	},
	setCurrentSize:function(size){
		var oldAnimate=this.animate;
		this.animate=false;
		this.adapter.setElementSize(this,size);
		this.animate=oldAnimate;
	},
	destroy:function(removeEl){
		Ext.destroy(this.shim,Ext.get(this.proxy));
		this.dd.unreg();
		if(removeEl){
			this.el.remove();
		}
		this.purgeListeners();
	}});
Ext.SplitBar.createProxy=function(dir){
	var proxy=new Ext.Element(document.createElement("div"));
	proxy.unselectable();
	var cls='x-splitbar-proxy';
	proxy.addClass(cls+' '+(dir==Ext.SplitBar.HORIZONTAL?cls+'-h':cls+'-v'));
	document.body.appendChild(proxy.dom);
	return proxy.dom;};
Ext.SplitBar.BasicLayoutAdapter=function(){};
Ext.SplitBar.BasicLayoutAdapter.prototype={
	init:function(s){
	},
	 getElementSize:function(s){
		if(s.orientation==Ext.SplitBar.HORIZONTAL){
			return s.resizingEl.getWidth();
		}else{
			return s.resizingEl.getHeight();
		}
	},
	setElementSize:function(s,newSize,onComplete){
		if(s.orientation==Ext.SplitBar.HORIZONTAL){
			if(!s.animate){
				s.resizingEl.setWidth(newSize);
				if(onComplete){
					onComplete(s,newSize);
				}
			}else{
				s.resizingEl.setWidth(newSize,true,.1,onComplete,'easeOut');
			}
		}else{
			if(!s.animate){
				s.resizingEl.setHeight(newSize);
				if(onComplete){
					onComplete(s,newSize);
				}
			}else{
				s.resizingEl.setHeight(newSize,true,.1,onComplete,'easeOut');
			}
		}
	}};
Ext.SplitBar.AbsoluteLayoutAdapter=function(container){
	this.basic=new Ext.SplitBar.BasicLayoutAdapter();
	this.container=Ext.get(container);};
Ext.SplitBar.AbsoluteLayoutAdapter.prototype={
	init:function(s){
		this.basic.init(s);
	},
	getElementSize:function(s){
		return this.basic.getElementSize(s);
	},
	setElementSize:function(s,newSize,onComplete){
		this.basic.setElementSize(s,newSize,this.moveSplitter.createDelegate(this,[s]));
	},
	moveSplitter:function(s){
		var yes=Ext.SplitBar;
		switch(s.placement){
			case yes.LEFT:
				s.el.setX(s.resizingEl.getRight());
				break;
			case yes.RIGHT:
				s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");
				break;
			case yes.TOP:
				s.el.setY(s.resizingEl.getBottom());
				break;
			case yes.BOTTOM:
				s.el.setY(s.resizingEl.getTop()-s.el.getHeight());
				break;
		}
	}};
Ext.SplitBar.VERTICAL=1;
Ext.SplitBar.HORIZONTAL=2;
Ext.SplitBar.LEFT=1;
Ext.SplitBar.RIGHT=2;
Ext.SplitBar.TOP=3;
Ext.SplitBar.BOTTOM=4;
Ext.Container=Ext.extend(Ext.BoxComponent,{
	bufferResize:100,
	autoDestroy:true,
	forceLayout:false,
	defaultType:'panel',
	initComponent:function(){
		Ext.Container.superclass.initComponent.call(this);
		this.addEvents(
			'afterlayout',
			'beforeadd',
			'beforeremove',
			'add',
			'remove'
		);
		this.enableBubble('add','remove');
		var items=this.items;
		if(items){
			delete this.items;
			if(Ext.isArray(items)&&items.length>0){
				this.add.apply(this,items);
			}else{
				this.add(items);
			}
		}
	},
	initItems:function(){
		if(!this.items){
			this.items=new Ext.util.MixedCollection(false,this.getComponentId);
			this.getLayout();
		}
	},
	setLayout:function(layout){
		if(this.layout&&this.layout!=layout){
			this.layout.setContainer(null);
		}
		this.initItems();
		this.layout=layout;
		layout.setContainer(this);
	},
	render:function(){
		Ext.Container.superclass.render.apply(this,arguments);
		if(this.layout){
			if(Ext.isObject(this.layout)&&!this.layout.layout){
				this.layoutConfig=this.layout;
				this.layout=this.layoutConfig.type;
			}
			if(typeof this.layout=='string'){
				this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);
			}
			this.setLayout(this.layout);
			if(this.activeItem!==undefined){
				var item=this.activeItem;
				delete this.activeItem;
				this.layout.setActiveItem(item);
			}
		}
		if(!this.ownerCt){
			this.doLayout(false,true);
		}
		if(this.monitorResize===true){
			Ext.EventManager.onWindowResize(this.doLayout,this,[false]);
		}
	},
	getLayoutTarget:function(){
		return this.el;
	},
	getComponentId:function(comp){
		return comp.getItemId();
	},
	add:function(comp){
		this.initItems();
		var args=arguments.length>1;
		if(args||Ext.isArray(comp)){
			Ext.each(args?arguments:comp,function(c){
				this.add(c);
			},this);
			return;
		}
		var c=this.lookupComponent(this.applyDefaults(comp));
		var pos=this.items.length;
		if(this.fireEvent('beforeadd',this,c,pos)!==false&&this.onBeforeAdd(c)!==false){
			this.items.add(c);
			c.ownerCt=this;
			this.fireEvent('add',this,c,pos);
		}
		return c;
	},
	insert:function(index,comp){
		this.initItems();
		var a=arguments,len=a.length;
		if(len>2){
			for(var i=len-1;i>=1;--i){
				this.insert(index,a[i]);
			}
			return;
		}
		var c=this.lookupComponent(this.applyDefaults(comp));
		if(c.ownerCt==this&&this.items.indexOf(c)<index){
			--index;
		}
		if(this.fireEvent('beforeadd',this,c,index)!==false&&this.onBeforeAdd(c)!==false){
			this.items.insert(index,c);
			c.ownerCt=this;
			this.fireEvent('add',this,c,index);
		}
		return c;
	},
	applyDefaults:function(c){
		if(this.defaults){
			if(typeof c=='string'){
				c=Ext.ComponentMgr.get(c);
				Ext.apply(c,this.defaults);
			}else if(!c.events){
				Ext.applyIf(c,this.defaults);
			}else{
				Ext.apply(c,this.defaults);
			}
		}
		return c;
	},
	onBeforeAdd:function(item){
		if(item.ownerCt){
			item.ownerCt.remove(item,false);
		}
		if(this.hideBorders===true){
			item.border=(item.border===true);
		}
	},
	remove:function(comp,autoDestroy){
		this.initItems();
		var c=this.getComponent(comp);
		if(c&&this.fireEvent('beforeremove',this,c)!==false){
			this.items.remove(c);
			delete c.ownerCt;
			if(autoDestroy===true||(autoDestroy!==false&&this.autoDestroy)){
				c.destroy();
			}
			if(this.layout&&this.layout.activeItem==c){
				delete this.layout.activeItem;
			}
			this.fireEvent('remove',this,c);
		}
		return c;
	},
	removeAll:function(autoDestroy){
		this.initItems();
		var item,rem=[],items=[];
		this.items.each(function(i){
			rem.push(i);
		});
		for(var i=0,len=rem.length;i<len;++i){
			item=rem[i];
			this.remove(item,autoDestroy);
			if(item.ownerCt!==this){
				items.push(item);
			}
		}
		return items;
	},
	getComponent:function(comp){
		if(Ext.isObject(comp)){
			return comp;
		}
		return this.items.get(comp);
	},
	lookupComponent:function(comp){
		if(typeof comp=='string'){
			return Ext.ComponentMgr.get(comp);
		}else if(!comp.events){
			return this.createComponent(comp);
		}
		return comp;
	},
	createComponent:function(config){
		return Ext.create(config,this.defaultType);
	},
	doLayout:function(shallow,force){
		var rendered=this.rendered,
			forceLayout=this.forceLayout;
		if(!this.isVisible()||this.collapsed){
			this.deferLayout=this.deferLayout||!shallow;
			if(!(force||forceLayout)){
				return;
			}
			shallow=shallow&&!this.deferLayout;
		}else{
			delete this.deferLayout;
		}
		if(rendered&&this.layout){
			this.layout.layout();
		}
		if(shallow!==true&&this.items){
			var cs=this.items.items;
			for(var i=0,len=cs.length;i<len;i++){
				var c=cs[i];
				if(c.doLayout){
					c.forceLayout=forceLayout;
					c.doLayout();
				}
			}
		}
		if(rendered){
			this.onLayout(shallow,force);
		}
		delete this.forceLayout;
	},
	onLayout:Ext.emptyFn,
	onShow:function(){
		Ext.Container.superclass.onShow.call(this);
		if(this.deferLayout!==undefined){
			this.doLayout(true);
		}
	},
	getLayout:function(){
		if(!this.layout){
			var layout=new Ext.layout.ContainerLayout(this.layoutConfig);
			this.setLayout(layout);
		}
		return this.layout;
	},
	beforeDestroy:function(){
		if(this.items){
			Ext.destroy.apply(Ext,this.items.items);
		}
		if(this.monitorResize){
			Ext.EventManager.removeResizeListener(this.doLayout,this);
		}
		Ext.destroy(this.layout);
		Ext.Container.superclass.beforeDestroy.call(this);
	},
	bubble:function(fn,scope,args){
		var p=this;
		while(p){
			if(fn.apply(scope||p,args||[p])===false){
				break;
			}
			p=p.ownerCt;
		}
		return this;
	},
	cascade:function(fn,scope,args){
		if(fn.apply(scope||this,args||[this])!==false){
			if(this.items){
				var cs=this.items.items;
				for(var i=0,len=cs.length;i<len;i++){
					if(cs[i].cascade){
						cs[i].cascade(fn,scope,args);
					}else{
						fn.apply(scope||cs[i],args||[cs[i]]);
					}
				}
			}
		}
		return this;
	},
	findById:function(id){
		var m,ct=this;
		this.cascade(function(c){
			if(ct!=c&&c.id===id){
				m=c;
				return false;
			}
		});
		return m||null;
	},
	findByType:function(xtype,shallow){
		return this.findBy(function(c){
			return c.isXType(xtype,shallow);
		});
	},
	find:function(prop,value){
		return this.findBy(function(c){
			return c[prop]===value;
		});
	},
	findBy:function(fn,scope){
		var m=[],ct=this;
		this.cascade(function(c){
			if(ct!=c&&fn.call(scope||c,c,ct)===true){
				m.push(c);
			}
		});
		return m;
	},
	get:function(key){
		return this.items.get(key);
	}});
Ext.Container.LAYOUTS={};
Ext.reg('container',Ext.Container);
Ext.layout.ContainerLayout=function(config){
	Ext.apply(this,config);};
Ext.layout.ContainerLayout.prototype={
	monitorResize:false,
	activeItem:null,
	layout:function(){
		var target=this.container.getLayoutTarget();
		this.onLayout(this.container,target);
		this.container.fireEvent('afterlayout',this.container,this);
	},
	onLayout:function(ct,target){
		this.renderAll(ct,target);
	},
	isValidParent:function(c,target){
		return target&&c.getDomPositionEl().dom.parentNode==(target.dom||target);
	},
	renderAll:function(ct,target){
		var items=ct.items.items;
		for(var i=0,len=items.length;i<len;i++){
			var c=items[i];
			if(c&&(!c.rendered||!this.isValidParent(c,target))){
				this.renderItem(c,i,target);
			}
		}
	},
	renderItem:function(c,position,target){
		if(c&&!c.rendered){
			c.render(target,position);
			this.configureItem(c,position);
		}else if(c&&!this.isValidParent(c,target)){
			if(typeof position=='number'){
				position=target.dom.childNodes[position];
			}
			target.dom.insertBefore(c.getDomPositionEl().dom,position||null);
			c.container=target;
			this.configureItem(c,position);
		}
	},
	configureItem:function(c,position){
		if(this.extraCls){
			var t=c.getPositionEl?c.getPositionEl():c;
			t.addClass(this.extraCls);
		}
		if(this.renderHidden&&c!=this.activeItem){
			c.hide();
		}
		if(c.doLayout){
			c.doLayout(false,this.forceLayout);
		}
	},
	onResize:function(){
		if(this.container.collapsed){
			return;
		}
		var b=this.container.bufferResize;
		if(b){
			if(!this.resizeTask){
				this.resizeTask=new Ext.util.DelayedTask(this.runLayout,this);
				this.resizeBuffer=typeof b=='number'?b:100;
			}
			this.resizeTask.delay(this.resizeBuffer);
		}else{
			this.runLayout();
		}
	},
	runLayout:function(){
		this.layout();
		this.container.onLayout();
	},
	setContainer:function(ct){
		if(this.monitorResize&&ct!=this.container){
			if(this.container){
				this.container.un('resize',this.onResize,this);
				this.container.un('bodyresize',this.onResize,this);
			}
			if(ct){
				ct.on({
					scope:this,
					resize:this.onResize,
					bodyresize:this.onResize
				});
			}
		}
		this.container=ct;
	},
	parseMargins:function(v){
		if(typeof v=='number'){
			v=v.toString();
		}
		var ms=v.split(' ');
		var len=ms.length;
		if(len==1){
			ms[1]=ms[0];
			ms[2]=ms[0];
			ms[3]=ms[0];
		}
		if(len==2){
			ms[2]=ms[0];
			ms[3]=ms[1];
		}
		if(len==3){
			ms[3]=ms[1];
		}
		return{
			top:parseInt(ms[0],10)||0,
			right:parseInt(ms[1],10)||0,
			bottom:parseInt(ms[2],10)||0,
			left:parseInt(ms[3],10)||0
		};
	},
	fieldTpl:(function(){
		var t=new Ext.Template(
			'<div class="x-form-item {itemCls}" tabIndex="-1">',
				'<label for="{id}" style="{labelStyle}" class="x-form-item-label">{label}{labelSeparator}</label>',
				'<div class="x-form-element" id="x-form-el-{id}" style="{elementStyle}">',
				'</div><div class="{clearCls}"></div>',
			'</div>'
		);
		t.disableFormats=true;
		return t.compile();
	})(),
	destroy:Ext.emptyFn};
Ext.Container.LAYOUTS['auto']=Ext.layout.ContainerLayout;
Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{
	monitorResize:true,
	onLayout:function(ct,target){
		Ext.layout.FitLayout.superclass.onLayout.call(this,ct,target);
		if(!this.container.collapsed){
			var sz=(Ext.isIE6&&Ext.isStrict&&target.dom==document.body)?target.getViewSize():target.getStyleSize();
			this.setItemSize(this.activeItem||ct.items.itemAt(0),sz);
		}
	},
	setItemSize:function(item,size){
		if(item&&size.height>0){
			item.setSize(size);
		}
	}});
Ext.Container.LAYOUTS['fit']=Ext.layout.FitLayout;
Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{
	deferredRender:false,
	layoutOnCardChange:false,
	renderHidden:true,
	constructor:function(config){
		Ext.layout.CardLayout.superclass.constructor.call(this,config);
		this.forceLayout=(this.deferredRender===false);
	},
	setActiveItem:function(item){
		item=this.container.getComponent(item);
		if(this.activeItem!=item){
			if(this.activeItem){
				this.activeItem.hide();
			}
			this.activeItem=item;
			item.show();
			this.container.doLayout();
			if(this.layoutOnCardChange&&item.doLayout){
				item.doLayout();
			}
		}
	},
	renderAll:function(ct,target){
		if(this.deferredRender){
			this.renderItem(this.activeItem,undefined,target);
		}else{
			Ext.layout.CardLayout.superclass.renderAll.call(this,ct,target);
		}
	}});
Ext.Container.LAYOUTS['card']=Ext.layout.CardLayout;
Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{
	monitorResize:true,
	getAnchorViewSize:function(ct,target){
		return target.dom==document.body?
				 target.getViewSize():target.getStyleSize();
	},
	onLayout:function(ct,target){
		Ext.layout.AnchorLayout.superclass.onLayout.call(this,ct,target);
		var size=this.getAnchorViewSize(ct,target);
		var w=size.width,h=size.height;
		if(w<20&&h<20){
			return;
		}
		var aw,ah;
		if(ct.anchorSize){
			if(typeof ct.anchorSize=='number'){
				aw=ct.anchorSize;
			}else{
				aw=ct.anchorSize.width;
				ah=ct.anchorSize.height;
			}
		}else{
			aw=ct.initialConfig.width;
			ah=ct.initialConfig.height;
		}
		var cs=ct.items.items,len=cs.length,i,c,a,cw,ch;
		for(i=0;i<len;i++){
			c=cs[i];
			if(c.anchor){
				a=c.anchorSpec;
				if(!a){
					var vs=c.anchor.split(' ');
					c.anchorSpec=a={
						right:this.parseAnchor(vs[0],c.initialConfig.width,aw),
						bottom:this.parseAnchor(vs[1],c.initialConfig.height,ah)
					};
				}
				cw=a.right?this.adjustWidthAnchor(a.right(w),c):undefined;
				ch=a.bottom?this.adjustHeightAnchor(a.bottom(h),c):undefined;
				if(cw||ch){
					c.setSize(cw||undefined,ch||undefined);
				}
			}
		}
	},
	parseAnchor:function(a,start,cstart){
		if(a&&a!='none'){
			var last;
			if(/^(r|right|b|bottom)$/i.test(a)){
				var diff=cstart-start;
				return function(v){
					if(v!==last){
						last=v;
						return v-diff;
					}
				}
			}else if(a.indexOf('%')!=-1){
				var ratio=parseFloat(a.replace('%',''))*.01;
				return function(v){
					if(v!==last){
						last=v;
						return Math.floor(v*ratio);
					}
				}
			}else{
				a=parseInt(a,10);
				if(!isNaN(a)){
					return function(v){
						if(v!==last){
							last=v;
							return v+a;
						}
					}
				}
			}
		}
		return false;
	},
	adjustWidthAnchor:function(value,comp){
		return value;
	},
	adjustHeightAnchor:function(value,comp){
		return value;
	}
	});
Ext.Container.LAYOUTS['anchor']=Ext.layout.AnchorLayout;
Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{
	monitorResize:true,
	extraCls:'x-column',
	scrollOffset:0,
	isValidParent:function(c,target){
		return(c.getPositionEl?c.getPositionEl():c.getEl()).dom.parentNode==this.innerCt.dom;
	},
	onLayout:function(ct,target){
		var cs=ct.items.items,len=cs.length,c,i;
		if(!this.innerCt){
			target.addClass('x-column-layout-ct');
			this.innerCt=target.createChild({cls:'x-column-inner'});
			this.innerCt.createChild({cls:'x-clear'});
		}
		this.renderAll(ct,this.innerCt);
		var size=Ext.isIE&&target.dom!=Ext.getBody().dom?target.getStyleSize():target.getViewSize();
		if(size.width<1&&size.height<1){
			return;
		}
		var w=size.width-target.getPadding('lr')-this.scrollOffset,
			h=size.height-target.getPadding('tb'),
			pw=w;
		this.innerCt.setWidth(w);
		for(i=0;i<len;i++){
			c=cs[i];
			if(!c.columnWidth){
				pw-=(c.getSize().width+c.getEl().getMargins('lr'));
			}
		}
		pw=pw<0?0:pw;
		for(i=0;i<len;i++){
			c=cs[i];
			if(c.columnWidth){
				c.setSize(Math.floor(c.columnWidth*pw)-c.getEl().getMargins('lr'));
			}
		}
	}
	});
Ext.Container.LAYOUTS['column']=Ext.layout.ColumnLayout;
Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{
	monitorResize:true,
	rendered:false,
	onLayout:function(ct,target){
		var collapsed;
		if(!this.rendered){
			target.addClass('x-border-layout-ct');
			var items=ct.items.items;
			collapsed=[];
			for(var i=0,len=items.length;i<len;i++){
				var c=items[i];
				var pos=c.region;
				if(c.collapsed){
					collapsed.push(c);
				}
				c.collapsed=false;
				if(!c.rendered){
					c.cls=c.cls?c.cls+' x-border-panel':'x-border-panel';
					c.render(target,i);
				}
				this[pos]=pos!='center'&&c.split?
					new Ext.layout.BorderLayout.SplitRegion(this,c.initialConfig,pos):
					new Ext.layout.BorderLayout.Region(this,c.initialConfig,pos);
				this[pos].render(target,c);
			}
			this.rendered=true;
		}
		var size=target.getViewSize();
		if(size.width<20||size.height<20){
			if(collapsed){
				this.restoreCollapsed=collapsed;
			}
			return;
		}else if(this.restoreCollapsed){
			collapsed=this.restoreCollapsed;
			delete this.restoreCollapsed;
		}
		var w=size.width,h=size.height;
		var centerW=w,centerH=h,centerY=0,centerX=0;
		var n=this.north,s=this.south,west=this.west,e=this.east,c=this.center;
		if(!c&&Ext.layout.BorderLayout.WARN!==false){
			throw'No center region defined in BorderLayout '+ct.id;
		}
		if(n&&n.isVisible()){
			var b=n.getSize();
			var m=n.getMargins();
			b.width=w-(m.left+m.right);
			b.x=m.left;
			b.y=m.top;
			centerY=b.height+b.y+m.bottom;
			centerH-=centerY;
			n.applyLayout(b);
		}
		if(s&&s.isVisible()){
			var b=s.getSize();
			var m=s.getMargins();
			b.width=w-(m.left+m.right);
			b.x=m.left;
			var totalHeight=(b.height+m.top+m.bottom);
			b.y=h-totalHeight+m.top;
			centerH-=totalHeight;
			s.applyLayout(b);
		}
		if(west&&west.isVisible()){
			var b=west.getSize();
			var m=west.getMargins();
			b.height=centerH-(m.top+m.bottom);
			b.x=m.left;
			b.y=centerY+m.top;
			var totalWidth=(b.width+m.left+m.right);
			centerX+=totalWidth;
			centerW-=totalWidth;
			west.applyLayout(b);
		}
		if(e&&e.isVisible()){
			var b=e.getSize();
			var m=e.getMargins();
			b.height=centerH-(m.top+m.bottom);
			var totalWidth=(b.width+m.left+m.right);
			b.x=w-totalWidth+m.left;
			b.y=centerY+m.top;
			centerW-=totalWidth;
			e.applyLayout(b);
		}
		if(c){
			var m=c.getMargins();
			var centerBox={
				x:centerX+m.left,
				y:centerY+m.top,
				width:centerW-(m.left+m.right),
				height:centerH-(m.top+m.bottom)
			};
			c.applyLayout(centerBox);
		}
		if(collapsed){
			for(var i=0,len=collapsed.length;i<len;i++){
				collapsed[i].collapse(false);
			}
		}
		if(Ext.isIE&&Ext.isStrict){
			target.repaint();
		}
	},
	destroy:function(){
		var r=['north','south','east','west'];
		for(var i=0;i<r.length;i++){
			var region=this[r[i]];
			if(region){
				if(region.destroy){
					region.destroy();
				}else if(region.split){
					region.split.destroy(true);
				}
			}
		}
		Ext.layout.BorderLayout.superclass.destroy.call(this);
	}
	});
Ext.layout.BorderLayout.Region=function(layout,config,pos){
	Ext.apply(this,config);
	this.layout=layout;
	this.position=pos;
	this.state={};
	if(typeof this.margins=='string'){
		this.margins=this.layout.parseMargins(this.margins);
	}
	this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);
	if(this.collapsible){
		if(typeof this.cmargins=='string'){
			this.cmargins=this.layout.parseMargins(this.cmargins);
		}
		if(this.collapseMode=='mini'&&!this.cmargins){
			this.cmargins={left:0,top:0,right:0,bottom:0};
		}else{
			this.cmargins=Ext.applyIf(this.cmargins||{},
				pos=='north'||pos=='south'?this.defaultNSCMargins:this.defaultEWCMargins);
		}
	}};
Ext.layout.BorderLayout.Region.prototype={
	collapsible:false,
	split:false,
	floatable:true,
	minWidth:50,
	minHeight:50,
	defaultMargins:{left:0,top:0,right:0,bottom:0},
	defaultNSCMargins:{left:5,top:5,right:5,bottom:5},
	defaultEWCMargins:{left:5,top:0,right:5,bottom:0},
	floatingZIndex:100,
	isCollapsed:false,
	render:function(ct,p){
		this.panel=p;
		p.el.enableDisplayMode();
		this.targetEl=ct;
		this.el=p.el;
		var gs=p.getState,ps=this.position;
		p.getState=function(){
			return Ext.apply(gs.call(p)||{},this.state);
		}.createDelegate(this);
		if(ps!='center'){
			p.allowQueuedExpand=false;
			p.on({
				beforecollapse:this.beforeCollapse,
				collapse:this.onCollapse,
				beforeexpand:this.beforeExpand,
				expand:this.onExpand,
				hide:this.onHide,
				show:this.onShow,
				scope:this
			});
			if(this.collapsible||this.floatable){
				p.collapseEl='el';
				p.slideAnchor=this.getSlideAnchor();
			}
			if(p.tools&&p.tools.toggle){
				p.tools.toggle.addClass('x-tool-collapse-'+ps);
				p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over');
			}
		}
	},
	getCollapsedEl:function(){
		if(!this.collapsedEl){
			if(!this.toolTemplate){
				var tt=new Ext.Template(
					'<div class="x-tool x-tool-{id}">&#160;</div>'
				);
				tt.disableFormats=true;
				tt.compile();
				Ext.layout.BorderLayout.Region.prototype.toolTemplate=tt;
			}
			this.collapsedEl=this.targetEl.createChild({
				cls:"x-layout-collapsed x-layout-collapsed-"+this.position,
				id:this.panel.id+'-xcollapsed'
			});
			this.collapsedEl.enableDisplayMode('block');
			if(this.collapseMode=='mini'){
				this.collapsedEl.addClass('x-layout-cmini-'+this.position);
				this.miniCollapsedEl=this.collapsedEl.createChild({
					cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"
				});
				this.miniCollapsedEl.addClassOnOver('x-layout-mini-over');
				this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
				this.collapsedEl.on('click',this.onExpandClick,this,{stopEvent:true});
			}else{
				if(this.collapsible!==false&&!this.hideCollapseTool){
					var t=this.toolTemplate.append(
							this.collapsedEl.dom,
							{id:'expand-'+this.position},true);
					t.addClassOnOver('x-tool-expand-'+this.position+'-over');
					t.on('click',this.onExpandClick,this,{stopEvent:true});
				}
				if(this.floatable!==false||this.titleCollapse){
				 this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
				 this.collapsedEl.on("click",this[this.floatable?'collapseClick':'onExpandClick'],this);
				}
			}
		}
		return this.collapsedEl;
	},
	onExpandClick:function(e){
		if(this.isSlid){
			this.afterSlideIn();
			this.panel.expand(false);
		}else{
			this.panel.expand();
		}
	},
	onCollapseClick:function(e){
		this.panel.collapse();
	},
	beforeCollapse:function(p,animate){
		this.lastAnim=animate;
		if(this.splitEl){
			this.splitEl.hide();
		}
		this.getCollapsedEl().show();
		this.panel.el.setStyle('z-index',100);
		this.isCollapsed=true;
		this.layout.layout();
	},
	onCollapse:function(animate){
		this.panel.el.setStyle('z-index',1);
		if(this.lastAnim===false||this.panel.animCollapse===false){
			this.getCollapsedEl().dom.style.visibility='visible';
		}else{
			this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:.2});
		}
		this.state.collapsed=true;
		this.panel.saveState();
	},
	beforeExpand:function(animate){
		var c=this.getCollapsedEl();
		this.el.show();
		if(this.position=='east'||this.position=='west'){
			this.panel.setSize(undefined,c.getHeight());
		}else{
			this.panel.setSize(c.getWidth(),undefined);
		}
		c.hide();
		c.dom.style.visibility='hidden';
		this.panel.el.setStyle('z-index',this.floatingZIndex);
	},
	onExpand:function(){
		this.isCollapsed=false;
		if(this.splitEl){
			this.splitEl.show();
		}
		this.layout.layout();
		this.panel.el.setStyle('z-index',1);
		this.state.collapsed=false;
		this.panel.saveState();
	},
	collapseClick:function(e){
		if(this.isSlid){
		 e.stopPropagation();
		 this.slideIn();
		}else{
		 e.stopPropagation();
		 this.slideOut();
		}
	},
	onHide:function(){
		if(this.isCollapsed){
			this.getCollapsedEl().hide();
		}else if(this.splitEl){
			this.splitEl.hide();
		}
	},
	onShow:function(){
		if(this.isCollapsed){
			this.getCollapsedEl().show();
		}else if(this.splitEl){
			this.splitEl.show();
		}
	},
	isVisible:function(){
		return!this.panel.hidden;
	},
	getMargins:function(){
		return this.isCollapsed&&this.cmargins?this.cmargins:this.margins;
	},
	getSize:function(){
		return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize();
	},
	setPanel:function(panel){
		this.panel=panel;
	},
	getMinWidth:function(){
		return this.minWidth;
	},
	getMinHeight:function(){
		return this.minHeight;
	},
	applyLayoutCollapsed:function(box){
		var ce=this.getCollapsedEl();
		ce.setLeftTop(box.x,box.y);
		ce.setSize(box.width,box.height);
	},
	applyLayout:function(box){
		if(this.isCollapsed){
			this.applyLayoutCollapsed(box);
		}else{
			this.panel.setPosition(box.x,box.y);
			this.panel.setSize(box.width,box.height);
		}
	},
	beforeSlide:function(){
		this.panel.beforeEffect();
	},
	afterSlide:function(){
		this.panel.afterEffect();
	},
	initAutoHide:function(){
		if(this.autoHide!==false){
			if(!this.autoHideHd){
				var st=new Ext.util.DelayedTask(this.slideIn,this);
				this.autoHideHd={
					"mouseout":function(e){
						if(!e.within(this.el,true)){
							st.delay(500);
						}
					},
					"mouseover":function(e){
						st.cancel();
					},
					scope:this
				};
			}
			this.el.on(this.autoHideHd);
		}
	},
	clearAutoHide:function(){
		if(this.autoHide!==false){
			this.el.un("mouseout",this.autoHideHd.mouseout);
			this.el.un("mouseover",this.autoHideHd.mouseover);
		}
	},
	clearMonitor:function(){
		Ext.getDoc().un("click",this.slideInIf,this);
	},
	slideOut:function(){
		if(this.isSlid||this.el.hasActiveFx()){
			return;
		}
		this.isSlid=true;
		var ts=this.panel.tools;
		if(ts&&ts.toggle){
			ts.toggle.hide();
		}
		this.el.show();
		if(this.position=='east'||this.position=='west'){
			this.panel.setSize(undefined,this.collapsedEl.getHeight());
		}else{
			this.panel.setSize(this.collapsedEl.getWidth(),undefined);
		}
		this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];
		this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());
		this.el.setStyle("z-index",this.floatingZIndex+2);
		this.panel.el.replaceClass('x-panel-collapsed','x-panel-floating');
		if(this.animFloat!==false){
			this.beforeSlide();
			this.el.slideIn(this.getSlideAnchor(),{
				callback:function(){
					this.afterSlide();
					this.initAutoHide();
					Ext.getDoc().on("click",this.slideInIf,this);
				},
				scope:this,
				block:true
			});
		}else{
			this.initAutoHide();
			 Ext.getDoc().on("click",this.slideInIf,this);
		}
	},
	afterSlideIn:function(){
		this.clearAutoHide();
		this.isSlid=false;
		this.clearMonitor();
		this.el.setStyle("z-index","");
		this.panel.el.replaceClass('x-panel-floating','x-panel-collapsed');
		this.el.dom.style.left=this.restoreLT[0];
		this.el.dom.style.top=this.restoreLT[1];
		var ts=this.panel.tools;
		if(ts&&ts.toggle){
			ts.toggle.show();
		}
	},
	slideIn:function(cb){
		if(!this.isSlid||this.el.hasActiveFx()){
			Ext.callback(cb);
			return;
		}
		this.isSlid=false;
		if(this.animFloat!==false){
			this.beforeSlide();
			this.el.slideOut(this.getSlideAnchor(),{
				callback:function(){
					this.el.hide();
					this.afterSlide();
					this.afterSlideIn();
					Ext.callback(cb);
				},
				scope:this,
				block:true
			});
		}else{
			this.el.hide();
			this.afterSlideIn();
		}
	},
	slideInIf:function(e){
		if(!e.within(this.el)){
			this.slideIn();
		}
	},
	anchors:{
		"west":"left",
		"east":"right",
		"north":"top",
		"south":"bottom"
	},
	sanchors:{
		"west":"l",
		"east":"r",
		"north":"t",
		"south":"b"
	},
	canchors:{
		"west":"tl-tr",
		"east":"tr-tl",
		"north":"tl-bl",
		"south":"bl-tl"
	},
	getAnchor:function(){
		return this.anchors[this.position];
	},
	getCollapseAnchor:function(){
		return this.canchors[this.position];
	},
	getSlideAnchor:function(){
		return this.sanchors[this.position];
	},
	getAlignAdj:function(){
		var cm=this.cmargins;
		switch(this.position){
			case"west":
				return[0,0];
			break;
			case"east":
				return[0,0];
			break;
			case"north":
				return[0,0];
			break;
			case"south":
				return[0,0];
			break;
		}
	},
	getExpandAdj:function(){
		var c=this.collapsedEl,cm=this.cmargins;
		switch(this.position){
			case"west":
				return[-(cm.right+c.getWidth()+cm.left),0];
			break;
			case"east":
				return[cm.right+c.getWidth()+cm.left,0];
			break;
			case"north":
				return[0,-(cm.top+cm.bottom+c.getHeight())];
			break;
			case"south":
				return[0,cm.top+cm.bottom+c.getHeight()];
			break;
		}
	}};
Ext.layout.BorderLayout.SplitRegion=function(layout,config,pos){
	Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,layout,config,pos);
	this.applyLayout=this.applyFns[pos];};
Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{
	splitTip:"Drag to resize.",
	collapsibleSplitTip:"Drag to resize. Double click to hide.",
	useSplitTips:false,
	splitSettings:{
		north:{
			orientation:Ext.SplitBar.VERTICAL,
			placement:Ext.SplitBar.TOP,
			maxFn:'getVMaxSize',
			minProp:'minHeight',
			maxProp:'maxHeight'
		},
		south:{
			orientation:Ext.SplitBar.VERTICAL,
			placement:Ext.SplitBar.BOTTOM,
			maxFn:'getVMaxSize',
			minProp:'minHeight',
			maxProp:'maxHeight'
		},
		east:{
			orientation:Ext.SplitBar.HORIZONTAL,
			placement:Ext.SplitBar.RIGHT,
			maxFn:'getHMaxSize',
			minProp:'minWidth',
			maxProp:'maxWidth'
		},
		west:{
			orientation:Ext.SplitBar.HORIZONTAL,
			placement:Ext.SplitBar.LEFT,
			maxFn:'getHMaxSize',
			minProp:'minWidth',
			maxProp:'maxWidth'
		}
	},
	applyFns:{
		west:function(box){
			if(this.isCollapsed){
				return this.applyLayoutCollapsed(box);
			}
			var sd=this.splitEl.dom,s=sd.style;
			this.panel.setPosition(box.x,box.y);
			var sw=sd.offsetWidth;
			s.left=(box.x+box.width-sw)+'px';
			s.top=(box.y)+'px';
			s.height=Math.max(0,box.height)+'px';
			this.panel.setSize(box.width-sw,box.height);
		},
		east:function(box){
			if(this.isCollapsed){
				return this.applyLayoutCollapsed(box);
			}
			var sd=this.splitEl.dom,s=sd.style;
			var sw=sd.offsetWidth;
			this.panel.setPosition(box.x+sw,box.y);
			s.left=(box.x)+'px';
			s.top=(box.y)+'px';
			s.height=Math.max(0,box.height)+'px';
			this.panel.setSize(box.width-sw,box.height);
		},
		north:function(box){
			if(this.isCollapsed){
				return this.applyLayoutCollapsed(box);
			}
			var sd=this.splitEl.dom,s=sd.style;
			var sh=sd.offsetHeight;
			this.panel.setPosition(box.x,box.y);
			s.left=(box.x)+'px';
			s.top=(box.y+box.height-sh)+'px';
			s.width=Math.max(0,box.width)+'px';
			this.panel.setSize(box.width,box.height-sh);
		},
		south:function(box){
			if(this.isCollapsed){
				return this.applyLayoutCollapsed(box);
			}
			var sd=this.splitEl.dom,s=sd.style;
			var sh=sd.offsetHeight;
			this.panel.setPosition(box.x,box.y+sh);
			s.left=(box.x)+'px';
			s.top=(box.y)+'px';
			s.width=Math.max(0,box.width)+'px';
			this.panel.setSize(box.width,box.height-sh);
		}
	},
	render:function(ct,p){
		Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,ct,p);
		var ps=this.position;
		this.splitEl=ct.createChild({
			cls:"x-layout-split x-layout-split-"+ps,html:"&#160;",
			id:this.panel.id+'-xsplit'
		});
		if(this.collapseMode=='mini'){
			this.miniSplitEl=this.splitEl.createChild({
				cls:"x-layout-mini x-layout-mini-"+ps,html:"&#160;"
			});
			this.miniSplitEl.addClassOnOver('x-layout-mini-over');
			this.miniSplitEl.on('click',this.onCollapseClick,this,{stopEvent:true});
		}
		var s=this.splitSettings[ps];
		this.split=new Ext.SplitBar(this.splitEl.dom,p.el,s.orientation);
		this.split.tickSize=this.tickSize;
		this.split.placement=s.placement;
		this.split.getMaximumSize=this[s.maxFn].createDelegate(this);
		this.split.minSize=this.minSize||this[s.minProp];
		this.split.on("beforeapply",this.onSplitMove,this);
		this.split.useShim=this.useShim===true;
		this.maxSize=this.maxSize||this[s.maxProp];
		if(p.hidden){
			this.splitEl.hide();
		}
		if(this.useSplitTips){
			this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip;
		}
		if(this.collapsible){
			this.splitEl.on("dblclick",this.onCollapseClick,this);
		}
	},
	getSize:function(){
		if(this.isCollapsed){
			return this.collapsedEl.getSize();
		}
		var s=this.panel.getSize();
		if(this.position=='north'||this.position=='south'){
			s.height+=this.splitEl.dom.offsetHeight;
		}else{
			s.width+=this.splitEl.dom.offsetWidth;
		}
		return s;
	},
	getHMaxSize:function(){
		 var cmax=this.maxSize||10000;
		 var center=this.layout.center;
		 return Math.min(cmax,(this.el.getWidth()+center.el.getWidth())-center.getMinWidth());
	},
	getVMaxSize:function(){
		var cmax=this.maxSize||10000;
		var center=this.layout.center;
		return Math.min(cmax,(this.el.getHeight()+center.el.getHeight())-center.getMinHeight());
	},
	onSplitMove:function(split,newSize){
		var s=this.panel.getSize();
		this.lastSplitSize=newSize;
		if(this.position=='north'||this.position=='south'){
			this.panel.setSize(s.width,newSize);
			this.state.height=newSize;
		}else{
			this.panel.setSize(newSize,s.height);
			this.state.width=newSize;
		}
		this.layout.layout();
		this.panel.saveState();
		return false;
	},
	getSplitBar:function(){
		return this.split;
	},
	destroy:function(){
		Ext.destroy(
			this.miniSplitEl,
			this.split,
			this.splitEl
		);
	}});
Ext.Container.LAYOUTS['border']=Ext.layout.BorderLayout;
Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{
	labelSeparator:':',
	setContainer:function(ct){
		Ext.layout.FormLayout.superclass.setContainer.call(this,ct);
		if(ct.labelAlign){
			ct.addClass('x-form-label-'+ct.labelAlign);
		}
		if(ct.hideLabels){
			this.labelStyle="display:none";
			this.elementStyle="padding-left:0;";
			this.labelAdjust=0;
		}else{
			this.labelSeparator=ct.labelSeparator||this.labelSeparator;
			ct.labelWidth=ct.labelWidth||100;
			if(typeof ct.labelWidth=='number'){
				var pad=(typeof ct.labelPad=='number'?ct.labelPad:5);
				this.labelAdjust=ct.labelWidth+pad;
				this.labelStyle="width:"+ct.labelWidth+"px;";
				this.elementStyle="padding-left:"+(ct.labelWidth+pad)+'px';
			}
			if(ct.labelAlign=='top'){
				this.labelStyle="width:auto;";
				this.labelAdjust=0;
				this.elementStyle="padding-left:0;";
			}
		}
	},
	getLabelStyle:function(s){
		var ls='',items=[this.labelStyle,s];
		for(var i=0,len=items.length;i<len;++i){
			if(items[i]){
				ls+=items[i];
				if(ls.substr(-1,1)!=';'){
					ls+=';'
				}
			}
		}
		return ls;
	},
	renderItem:function(c,position,target){
		if(c&&!c.rendered&&(c.isFormField||c.fieldLabel)&&c.inputType!='hidden'){
			var args=this.getTemplateArgs(c);
			if(typeof position=='number'){
				position=target.dom.childNodes[position]||null;
			}
			if(position){
				this.fieldTpl.insertBefore(position,args);
			}else{
				this.fieldTpl.append(target,args);
			}
			c.render('x-form-el-'+c.id);
		}else{
			Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments);
		}
	},
	getTemplateArgs:function(field){
		var noLabelSep=!field.fieldLabel||field.hideLabel;
		return{
			id:field.id,
			label:field.fieldLabel,
			labelStyle:field.labelStyle||this.labelStyle||'',
			elementStyle:this.elementStyle||'',
			labelSeparator:noLabelSep?'':(typeof field.labelSeparator=='undefined'?this.labelSeparator:field.labelSeparator),
			itemCls:(field.itemCls||this.container.itemCls||'')+(field.hideLabel?' x-hide-label':''),
			clearCls:field.clearCls||'x-form-clear-left'
		};
	},
	adjustWidthAnchor:function(value,comp){
		return value-(comp.isFormField||comp.fieldLabel?(comp.hideLabel?0:this.labelAdjust):0);
	},
	isValidParent:function(c,target){
		return true;
	}
	});
Ext.Container.LAYOUTS['form']=Ext.layout.FormLayout;
Ext.layout.AccordionLayout=Ext.extend(Ext.layout.FitLayout,{
	fill:true,
	autoWidth:true,
	titleCollapse:true,
	hideCollapseTool:false,
	collapseFirst:false,
	animate:false,
	sequence:false,
	activeOnTop:false,
	renderItem:function(c){
		if(this.animate===false){
			c.animCollapse=false;
		}
		c.collapsible=true;
		if(this.autoWidth){
			c.autoWidth=true;
		}
		if(this.titleCollapse){
			c.titleCollapse=true;
		}
		if(this.hideCollapseTool){
			c.hideCollapseTool=true;
		}
		if(this.collapseFirst!==undefined){
			c.collapseFirst=this.collapseFirst;
		}
		if(!this.activeItem&&!c.collapsed){
			this.activeItem=c;
		}else if(this.activeItem&&this.activeItem!=c){
			c.collapsed=true;
		}
		Ext.layout.AccordionLayout.superclass.renderItem.apply(this,arguments);
		c.header.addClass('x-accordion-hd');
		c.on('beforeexpand',this.beforeExpand,this);
	},
	beforeExpand:function(p,anim){
		var ai=this.activeItem;
		if(ai){
			if(this.sequence){
				delete this.activeItem;
				if(!ai.collapsed){
					ai.collapse({callback:function(){
						p.expand(anim||true);
					},scope:this});
					return false;
				}
			}else{
				ai.collapse(this.animate);
			}
		}
		this.activeItem=p;
		if(this.activeOnTop){
			p.el.dom.parentNode.insertBefore(p.el.dom,p.el.dom.parentNode.firstChild);
		}
		this.layout();
	},
	setItemSize:function(item,size){
		if(this.fill&&item){
			var hh=0;
			this.container.items.each(function(p){
				if(p!=item){
					hh+=p.header.getHeight();
				}
			});
			size.height-=hh;
			item.setSize(size);
		}
	},
	setActiveItem:function(item){
		item=this.container.getComponent(item);
		if(this.activeItem!=item){
			if(item.rendered&&item.collapsed){
				item.expand();
			}else{
				this.activeItem=item;
			}
		}
	}});
Ext.Container.LAYOUTS.accordion=Ext.layout.AccordionLayout;
Ext.layout.Accordion=Ext.layout.AccordionLayout;
Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{
	monitorResize:false,
	tableAttrs:null,
	setContainer:function(ct){
		Ext.layout.TableLayout.superclass.setContainer.call(this,ct);
		this.currentRow=0;
		this.currentColumn=0;
		this.cells=[];
	},
	onLayout:function(ct,target){
		var cs=ct.items.items,len=cs.length,c,i;
		if(!this.table){
			target.addClass('x-table-layout-ct');
			this.table=target.createChild(
				Ext.apply({tag:'table',cls:'x-table-layout',cellspacing:0,cn:{tag:'tbody'}},this.tableAttrs),null,true);
		}
		this.renderAll(ct,target);
	},
	getRow:function(index){
		var row=this.table.tBodies[0].childNodes[index];
		if(!row){
			row=document.createElement('tr');
			this.table.tBodies[0].appendChild(row);
		}
		return row;
	},
	getNextCell:function(c){
		var cell=this.getNextNonSpan(this.currentColumn,this.currentRow);
		var curCol=this.currentColumn=cell[0],curRow=this.currentRow=cell[1];
		for(var rowIndex=curRow;rowIndex<curRow+(c.rowspan||1);rowIndex++){
			if(!this.cells[rowIndex]){
				this.cells[rowIndex]=[];
			}
			for(var colIndex=curCol;colIndex<curCol+(c.colspan||1);colIndex++){
				this.cells[rowIndex][colIndex]=true;
			}
		}
		var td=document.createElement('td');
		if(c.cellId){
			td.id=c.cellId;
		}
		var cls='x-table-layout-cell';
		if(c.cellCls){
			cls+=' '+c.cellCls;
		}
		td.className=cls;
		if(c.colspan){
			td.colSpan=c.colspan;
		}
		if(c.rowspan){
			td.rowSpan=c.rowspan;
		}
		this.getRow(curRow).appendChild(td);
		return td;
	},
	getNextNonSpan:function(colIndex,rowIndex){
		var cols=this.columns;
		while((cols&&colIndex>=cols)||(this.cells[rowIndex]&&this.cells[rowIndex][colIndex])){
			if(cols&&colIndex>=cols){
				rowIndex++;
				colIndex=0;
			}else{
				colIndex++;
			}
		}
		return[colIndex,rowIndex];
	},
	renderItem:function(c,position,target){
		if(c&&!c.rendered){
			c.render(this.getNextCell(c));
			if(this.extraCls){
				var t=c.getPositionEl?c.getPositionEl():c;
				t.addClass(this.extraCls);
			}
		}
	},
	isValidParent:function(c,target){
		return true;
	}
	});
Ext.Container.LAYOUTS['table']=Ext.layout.TableLayout;
Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{
	extraCls:'x-abs-layout-item',
	onLayout:function(ct,target){
		target.position();
		this.paddingLeft=target.getPadding('l');
		this.paddingTop=target.getPadding('t');
		Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,ct,target);
	},
	adjustWidthAnchor:function(value,comp){
		return value?value-comp.getPosition(true)[0]+this.paddingLeft:value;
	},
	adjustHeightAnchor:function(value,comp){
		return value?value-comp.getPosition(true)[1]+this.paddingTop:value;
	}
	});
Ext.Container.LAYOUTS['absolute']=Ext.layout.AbsoluteLayout;
Ext.layout.BoxLayout=Ext.extend(Ext.layout.ContainerLayout,{
	defaultMargins:{left:0,top:0,right:0,bottom:0},
	padding:'0',
	pack:'start',
	monitorResize:true,
	scrollOffset:0,
	extraCls:'x-box-item',
	ctCls:'x-box-layout-ct',
	innerCls:'x-box-inner',
	isValidParent:function(c,target){
		return c.getEl().dom.parentNode==this.innerCt.dom;
	},
	onLayout:function(ct,target){
		var cs=ct.items.items,len=cs.length,c,i,last=len-1,cm;
		if(!this.innerCt){
			target.addClass(this.ctCls);
			this.innerCt=target.createChild({cls:this.innerCls});
			this.padding=this.parseMargins(this.padding);
		}
		this.renderAll(ct,this.innerCt);
	},
	renderItem:function(c){
		if(typeof c.margins=='string'){
			c.margins=this.parseMargins(c.margins);
		}else if(!c.margins){
			c.margins=this.defaultMargins;
		}
		Ext.layout.BoxLayout.superclass.renderItem.apply(this,arguments);
	},
	getTargetSize:function(target){
		return(Ext.isIE6&&Ext.isStrict&&target.dom==document.body)?target.getStyleSize():target.getViewSize();
	},
	getItems:function(ct){
		var items=[];
		ct.items.each(function(c){
			if(c.isVisible()){
				items.push(c);
			}
		});
		return items;
	}
	});
Ext.layout.VBoxLayout=Ext.extend(Ext.layout.BoxLayout,{
	align:'left',
	onLayout:function(ct,target){
		Ext.layout.VBoxLayout.superclass.onLayout.call(this,ct,target);
		var cs=this.getItems(ct),cm,ch,margin,
			size=this.getTargetSize(target),
			w=size.width-target.getPadding('lr')-this.scrollOffset,
			h=size.height-target.getPadding('tb'),
			l=this.padding.left,t=this.padding.top,
			isStart=this.pack=='start',
			isRestore=['stretch','stretchmax'].indexOf(this.align)==-1,
			stretchWidth=w-(this.padding.left+this.padding.right),
			extraHeight=0,
			maxWidth=0,
			totalFlex=0,
			flexHeight=0,
			usedHeight=0;
		Ext.each(cs,function(c){
			cm=c.margins;
			totalFlex+=c.flex||0;
			ch=c.getHeight();
			margin=cm.top+cm.bottom;
			extraHeight+=ch+margin;
			flexHeight+=margin+(c.flex?0:ch);
			maxWidth=Math.max(maxWidth,c.getWidth()+cm.left+cm.right);
		});
		extraHeight=h-extraHeight-this.padding.top-this.padding.bottom;
		var innerCtWidth=maxWidth+this.padding.left+this.padding.right;
		switch(this.align){
			case'stretch':
				this.innerCt.setSize(w,h);
				break;
			case'stretchmax':
			case'left':
				this.innerCt.setSize(innerCtWidth,h);
				break;
			case'center':
				this.innerCt.setSize(w=Math.max(w,innerCtWidth),h);
				break;
		}
		var availHeight=Math.max(0,h-this.padding.top-this.padding.bottom-flexHeight),
			leftOver=availHeight,
			heights=[],
			restore=[],
			idx=0,
			availableWidth=Math.max(0,w-this.padding.left-this.padding.right);
		Ext.each(cs,function(c){
			if(isStart&&c.flex){
				ch=Math.floor(availHeight*(c.flex/totalFlex));
				leftOver-=ch;
				heights.push(ch);
			}
		});
		if(this.pack=='center'){
			t+=extraHeight?extraHeight/2:0;
		}else if(this.pack=='end'){
			t+=extraHeight;
		}
		Ext.each(cs,function(c){
			cm=c.margins;
			t+=cm.top;
			c.setPosition(l+cm.left,t);
			if(isStart&&c.flex){
				ch=Math.max(0,heights[idx++]+(leftOver-->0?1:0));
				if(isRestore){
					restore.push(c.getWidth());
				}
				c.setSize(availableWidth,ch);
			}else{
				ch=c.getHeight();
			}
			t+=ch+cm.bottom;
		});
		idx=0;
		Ext.each(cs,function(c){
			cm=c.margins;
			if(this.align=='stretch'){
				c.setWidth((stretchWidth-(cm.left+cm.right)).constrain(
					c.minWidth||0,c.maxWidth||1000000));
			}else if(this.align=='stretchmax'){
				c.setWidth((maxWidth-(cm.left+cm.right)).constrain(
					c.minWidth||0,c.maxWidth||1000000));
			}else{
				if(this.align=='center'){
					var diff=availableWidth-(c.getWidth()+cm.left+cm.right);
					if(diff>0){
						c.setPosition(l+cm.left+(diff/2),c.y);
					}
				}
				if(isStart&&c.flex){
					c.setWidth(restore[idx++]);
				}
			}
		},this);
	}
	});
Ext.Container.LAYOUTS.vbox=Ext.layout.VBoxLayout;
Ext.layout.HBoxLayout=Ext.extend(Ext.layout.BoxLayout,{
	align:'top',
	onLayout:function(ct,target){
		Ext.layout.HBoxLayout.superclass.onLayout.call(this,ct,target);
		var cs=this.getItems(ct),cm,cw,margin,
			size=this.getTargetSize(target),
			w=size.width-target.getPadding('lr')-this.scrollOffset,
			h=size.height-target.getPadding('tb'),
			l=this.padding.left,t=this.padding.top,
			isStart=this.pack=='start',
			isRestore=['stretch','stretchmax'].indexOf(this.align)==-1,
			stretchHeight=h-(this.padding.top+this.padding.bottom),
			extraWidth=0,
			maxHeight=0,
			totalFlex=0,
			flexWidth=0,
			usedWidth=0;
		Ext.each(cs,function(c){
			cm=c.margins;
			totalFlex+=c.flex||0;
			cw=c.getWidth();
			margin=cm.left+cm.right;
			extraWidth+=cw+margin;
			flexWidth+=margin+(c.flex?0:cw);
			maxHeight=Math.max(maxHeight,c.getHeight()+cm.top+cm.bottom);
		});
		extraWidth=w-extraWidth-this.padding.left-this.padding.right;
		var innerCtHeight=maxHeight+this.padding.top+this.padding.bottom;
		switch(this.align){
			case'stretch':
				this.innerCt.setSize(w,h);
				break;
			case'stretchmax':
			case'top':
				this.innerCt.setSize(w,innerCtHeight);
				break;
			case'middle':
				this.innerCt.setSize(w,h=Math.max(h,innerCtHeight));
				break;
		}
		var availWidth=Math.max(0,w-this.padding.left-this.padding.right-flexWidth),
			leftOver=availWidth,
			widths=[],
			restore=[],
			idx=0,
			availableHeight=Math.max(0,h-this.padding.top-this.padding.bottom);
		Ext.each(cs,function(c){
			if(isStart&&c.flex){
				cw=Math.floor(availWidth*(c.flex/totalFlex));
				leftOver-=cw;
				widths.push(cw);
			}
		});
		if(this.pack=='center'){
			l+=extraWidth?extraWidth/2:0;
		}else if(this.pack=='end'){
			l+=extraWidth;
		}
		Ext.each(cs,function(c){
			cm=c.margins;
			l+=cm.left;
			c.setPosition(l,t+cm.top);
			if(isStart&&c.flex){
				cw=Math.max(0,widths[idx++]+(leftOver-->0?1:0));
				if(isRestore){
					restore.push(c.getHeight());
				}
				c.setSize(cw,availableHeight);
			}else{
				cw=c.getWidth();
			}
			l+=cw+cm.right;
		});
		idx=0;
		Ext.each(cs,function(c){
			var cm=c.margins;
			if(this.align=='stretch'){
				c.setHeight((stretchHeight-(cm.top+cm.bottom)).constrain(
					c.minHeight||0,c.maxHeight||1000000));
			}else if(this.align=='stretchmax'){
				c.setHeight((maxHeight-(cm.top+cm.bottom)).constrain(
					c.minHeight||0,c.maxHeight||1000000));
			}else{
				if(this.align=='middle'){
					var diff=availableHeight-(c.getHeight()+cm.top+cm.bottom);
					if(diff>0){
						c.setPosition(c.x,t+cm.top+(diff/2));
					}
				}
				if(isStart&&c.flex){
					c.setHeight(restore[idx++]);
				}
			}
		},this);
	}
	});
Ext.Container.LAYOUTS.hbox=Ext.layout.HBoxLayout;
Ext.Viewport=Ext.extend(Ext.Container,{
	initComponent:function(){
		Ext.Viewport.superclass.initComponent.call(this);
		document.getElementsByTagName('html')[0].className+=' x-viewport';
		this.el=Ext.getBody();
		this.el.setHeight=Ext.emptyFn;
		this.el.setWidth=Ext.emptyFn;
		this.el.setSize=Ext.emptyFn;
		this.el.dom.scroll='no';
		this.allowDomMove=false;
		this.autoWidth=true;
		this.autoHeight=true;
		Ext.EventManager.onWindowResize(this.fireResize,this);
		this.renderTo=this.el;
	},
	fireResize:function(w,h){
		this.fireEvent('resize',this,w,h,w,h);
	}});
Ext.reg('viewport',Ext.Viewport);
Ext.Panel=Ext.extend(Ext.Container,{
	baseCls:'x-panel',
	collapsedCls:'x-panel-collapsed',
	maskDisabled:true,
	animCollapse:Ext.enableFx,
	headerAsText:true,
	buttonAlign:'right',
	collapsed:false,
	collapseFirst:true,
	minButtonWidth:75,
	elements:'body',
	preventBodyReset:false,
	toolTarget:'header',
	collapseEl:'bwrap',
	slideAnchor:'t',
	disabledClass:'',
	deferHeight:true,
	expandDefaults:{
		duration:0.25
	},
	collapseDefaults:{
		duration:0.25
	},
	initComponent:function(){
		Ext.Panel.superclass.initComponent.call(this);
		this.addEvents(
			'bodyresize',
			'titlechange',
			'iconchange',
			'collapse',
			'expand',
			'beforecollapse',
			'beforeexpand',
			'beforeclose',
			'close',
			'activate',
			'deactivate'
		);
		if(this.unstyled){
			this.baseCls='x-plain';
		}
		if(this.tbar){
			this.elements+=',tbar';
			if(Ext.isObject(this.tbar)){
				this.topToolbar=this.tbar;
			}
			delete this.tbar;
		}
		if(this.bbar){
			this.elements+=',bbar';
			if(Ext.isObject(this.bbar)){
				this.bottomToolbar=this.bbar;
			}
			delete this.bbar;
		}
		if(this.header===true){
			this.elements+=',header';
			delete this.header;
		}else if(this.headerCfg||(this.title&&this.header!==false)){
			this.elements+=',header';
		}
		if(this.footerCfg||this.footer===true){
			this.elements+=',footer';
			delete this.footer;
		}
		if(this.buttons){
			this.elements+=',footer';
			var btns=this.buttons;
			this.buttons=[];
			for(var i=0,len=btns.length;i<len;i++){
				if(btns[i].render){
					this.buttons.push(btns[i]);
				}else if(btns[i].xtype){
					this.buttons.push(Ext.create(btns[i],'button'));
				}else{
					this.addButton(btns[i]);
				}
			}
		}
		if(this.fbar){
			this.elements+=',footer';
		}
		if(this.autoLoad){
			this.on('render',this.doAutoLoad,this,{delay:10});
		}
	},
	createElement:function(name,pnode){
		if(this[name]){
			pnode.appendChild(this[name].dom);
			return;
		}
		if(name==='bwrap'||this.elements.indexOf(name)!=-1){
			if(this[name+'Cfg']){
				this[name]=Ext.fly(pnode).createChild(this[name+'Cfg']);
			}else{
				var el=document.createElement('div');
				el.className=this[name+'Cls'];
				this[name]=Ext.get(pnode.appendChild(el));
			}
			if(this[name+'CssClass']){
				this[name].addClass(this[name+'CssClass']);
			}
			if(this[name+'Style']){
				this[name].applyStyles(this[name+'Style']);
			}
		}
	},
	onRender:function(ct,position){
		Ext.Panel.superclass.onRender.call(this,ct,position);
		this.createClasses();
		var el=this.el,
			d=el.dom,
			bw;
		el.addClass(this.baseCls);
		if(d.firstChild){
			this.header=el.down('.'+this.headerCls);
			this.bwrap=el.down('.'+this.bwrapCls);
			var cp=this.bwrap?this.bwrap:el;
			this.tbar=cp.down('.'+this.tbarCls);
			this.body=cp.down('.'+this.bodyCls);
			this.bbar=cp.down('.'+this.bbarCls);
			this.footer=cp.down('.'+this.footerCls);
			this.fromMarkup=true;
		}
		if(this.preventBodyReset===true){
			el.addClass('x-panel-reset');
		}
		if(this.cls){
			el.addClass(this.cls);
		}
		if(this.buttons){
			this.elements+=',footer';
		}
		if(this.frame){
			el.insertHtml('afterBegin',String.format(Ext.Element.boxMarkup,this.baseCls));
			this.createElement('header',d.firstChild.firstChild.firstChild);
			this.createElement('bwrap',d);
			bw=this.bwrap.dom;
			var ml=d.childNodes[1],bl=d.childNodes[2];
			bw.appendChild(ml);
			bw.appendChild(bl);
			var mc=bw.firstChild.firstChild.firstChild;
			this.createElement('tbar',mc);
			this.createElement('body',mc);
			this.createElement('bbar',mc);
			this.createElement('footer',bw.lastChild.firstChild.firstChild);
			if(!this.footer){
				this.bwrap.dom.lastChild.className+=' x-panel-nofooter';
			}
		}else{
			this.createElement('header',d);
			this.createElement('bwrap',d);
			bw=this.bwrap.dom;
			this.createElement('tbar',bw);
			this.createElement('body',bw);
			this.createElement('bbar',bw);
			this.createElement('footer',bw);
			if(!this.header){
				this.body.addClass(this.bodyCls+'-noheader');
				if(this.tbar){
					this.tbar.addClass(this.tbarCls+'-noheader');
				}
			}
		}
		if(this.padding!==undefined){
			this.body.setStyle('padding',this.body.addUnits(this.padding));
		}
		if(this.border===false){
			this.el.addClass(this.baseCls+'-noborder');
			this.body.addClass(this.bodyCls+'-noborder');
			if(this.header){
				this.header.addClass(this.headerCls+'-noborder');
			}
			if(this.footer){
				this.footer.addClass(this.footerCls+'-noborder');
			}
			if(this.tbar){
				this.tbar.addClass(this.tbarCls+'-noborder');
			}
			if(this.bbar){
				this.bbar.addClass(this.bbarCls+'-noborder');
			}
		}
		if(this.bodyBorder===false){
		 this.body.addClass(this.bodyCls+'-noborder');
		}
		this.bwrap.enableDisplayMode('block');
		if(this.header){
			this.header.unselectable();
			if(this.headerAsText){
				this.header.dom.innerHTML=
					'<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+'</span>';
				if(this.iconCls){
					this.setIconClass(this.iconCls);
				}
			}
		}
		if(this.floating){
			this.makeFloating(this.floating);
		}
		if(this.collapsible){
			this.tools=this.tools?this.tools.slice(0):[];
			if(!this.hideCollapseTool){
				this.tools[this.collapseFirst?'unshift':'push']({
					id:'toggle',
					handler:this.toggleCollapse,
					scope:this
				});
			}
			if(this.titleCollapse&&this.header){
				this.mon(this.header,'click',this.toggleCollapse,this);
				this.header.setStyle('cursor','pointer');
			}
		}
		if(this.tools){
			var ts=this.tools;
			this.tools={};
			this.addTool.apply(this,ts);
		}else{
			this.tools={};
		}
		if(this.buttons&&this.buttons.length>0){
			this.fbar=new Ext.Toolbar({
				items:this.buttons,
				toolbarCls:'x-panel-fbar'
			});
		}
		this.toolbars=[];
		if(this.fbar){
			this.fbar=Ext.create(this.fbar,'toolbar');
			this.fbar.enableOverflow=false;
			if(this.fbar.items){
				this.fbar.items.each(function(c){
					c.minWidth=c.minWidth||this.minButtonWidth;
				},this);
			}
			this.fbar.toolbarCls='x-panel-fbar';
			var bct=this.footer.createChild({cls:'x-panel-btns x-panel-btns-'+this.buttonAlign});
			this.fbar.ownerCt=this;
			this.fbar.render(bct);
			bct.createChild({cls:'x-clear'});
			this.toolbars.push(this.fbar);
		}
		if(this.tbar&&this.topToolbar){
			if(Ext.isArray(this.topToolbar)){
				this.topToolbar=new Ext.Toolbar(this.topToolbar);
			}else if(!this.topToolbar.events){
				this.topToolbar=Ext.create(this.topToolbar,'toolbar');
			}
			this.topToolbar.ownerCt=this;
			this.topToolbar.render(this.tbar);
			this.toolbars.push(this.topToolbar);
		}
		if(this.bbar&&this.bottomToolbar){
			if(Ext.isArray(this.bottomToolbar)){
				this.bottomToolbar=new Ext.Toolbar(this.bottomToolbar);
			}else if(!this.bottomToolbar.events){
				this.bottomToolbar=Ext.create(this.bottomToolbar,'toolbar');
			}
			this.bottomToolbar.ownerCt=this;
			this.bottomToolbar.render(this.bbar);
			this.toolbars.push(this.bottomToolbar);
		}
		Ext.each(this.toolbars,function(tb){
			tb.on({
				scope:this,
				afterlayout:this.syncHeight,
				remove:this.syncHeight
			});
		},this);
	},
	setIconClass:function(cls){
		var old=this.iconCls;
		this.iconCls=cls;
		if(this.rendered&&this.header){
			if(this.frame){
				this.header.addClass('x-panel-icon');
				this.header.replaceClass(old,this.iconCls);
			}else{
				var hd=this.header.dom;
				var img=hd.firstChild&&String(hd.firstChild.tagName).toLowerCase()=='img'?hd.firstChild:null;
				if(img){
					Ext.fly(img).replaceClass(old,this.iconCls);
				}else{
					Ext.DomHelper.insertBefore(hd.firstChild,{
						tag:'img',src:Ext.BLANK_IMAGE_URL,cls:'x-panel-inline-icon '+this.iconCls
					});
				}
			}
		}
		this.fireEvent('iconchange',this,cls,old);
	},
	makeFloating:function(cfg){
		this.floating=true;
		this.el=new Ext.Layer(
			Ext.isObject(cfg)?cfg:{
				shadow:this.shadow!==undefined?this.shadow:'sides',
				shadowOffset:this.shadowOffset,
				constrain:false,
				shim:this.shim===false?false:undefined
			},this.el
		);
	},
	getTopToolbar:function(){
		return this.topToolbar;
	},
	getBottomToolbar:function(){
		return this.bottomToolbar;
	},
	addButton:function(config,handler,scope){
		var bc={
			handler:handler,
			scope:scope,
			minWidth:this.minButtonWidth,
			hideParent:true
		};
		if(typeof config=="string"){
			bc.text=config;
		}else{
			Ext.apply(bc,config);
		}
		var btn=new Ext.Button(bc);
		if(!this.buttons){
			this.buttons=[];
		}
		this.buttons.push(btn);
		return btn;
	},
	addTool:function(){
		if(!this[this.toolTarget]){
			return;
		}
		if(!this.toolTemplate){
			var tt=new Ext.Template(
				'<div class="x-tool x-tool-{id}">&#160;</div>'
			);
			tt.disableFormats=true;
			tt.compile();
			Ext.Panel.prototype.toolTemplate=tt;
		}
		for(var i=0,a=arguments,len=a.length;i<len;i++){
			var tc=a[i];
			if(!this.tools[tc.id]){
				var overCls='x-tool-'+tc.id+'-over';
				var t=this.toolTemplate.insertFirst((tc.align!=='left')?this[this.toolTarget]:this[this.toolTarget].child('span'),tc,true);
				this.tools[tc.id]=t;
				t.enableDisplayMode('block');
				this.mon(t,'click',this.createToolHandler(t,tc,overCls,this));
				if(tc.on){
					this.mon(t,tc.on);
				}
				if(tc.hidden){
					t.hide();
				}
				if(tc.qtip){
					if(Ext.isObject(tc.qtip)){
						Ext.QuickTips.register(Ext.apply({
							 target:t.id
						},tc.qtip));
					}else{
						t.dom.qtip=tc.qtip;
					}
				}
				t.addClassOnOver(overCls);
			}
		}
	},
	onLayout:function(){
		if(this.toolbars.length>0){
			this.duringLayout=true;
			Ext.each(this.toolbars,function(tb){
				tb.doLayout();
			});
			delete this.duringLayout;
			this.syncHeight();
		}
	},
	syncHeight:function(){
		if(!(this.autoHeight||this.duringLayout)){
			var last=this.lastSize;
			if(last&&!Ext.isEmpty(last.height)){
				var old=last.height,h=this.el.getHeight();
				if(old!='auto'&&old!=h){
					var bd=this.body,bdh=bd.getHeight();
					h=Math.max(bdh+old-h,0);
					if(bdh>0&&bdh!=h){
						bd.setHeight(h);
						if(Ext.isIE&&h<=0){
							return;
						}
						var sz=bd.getSize();
						this.fireEvent('bodyresize',sz.width,sz.height);
					}
				}
			}
		}
	},
	onShow:function(){
		if(this.floating){
			return this.el.show();
		}
		Ext.Panel.superclass.onShow.call(this);
	},
	onHide:function(){
		if(this.floating){
			return this.el.hide();
		}
		Ext.Panel.superclass.onHide.call(this);
	},
	createToolHandler:function(t,tc,overCls,panel){
		return function(e){
			t.removeClass(overCls);
			if(tc.stopEvent!==false){
				e.stopEvent();
			}
			if(tc.handler){
				tc.handler.call(tc.scope||t,e,t,panel,tc);
			}
		};
	},
	afterRender:function(){
		if(this.floating&&!this.hidden){
			this.el.show();
		}
		if(this.title){
			this.setTitle(this.title);
		}
		this.setAutoScroll();
		if(this.html){
			this.body.update(Ext.isObject(this.html)?
							 Ext.DomHelper.markup(this.html):
							 this.html);
			delete this.html;
		}
		if(this.contentEl){
			var ce=Ext.getDom(this.contentEl);
			Ext.fly(ce).removeClass(['x-hidden','x-hide-display']);
			this.body.dom.appendChild(ce);
		}
		if(this.collapsed){
			this.collapsed=false;
			this.collapse(false);
		}
		Ext.Panel.superclass.afterRender.call(this);
		this.initEvents();
	},
	setAutoScroll:function(){
		if(this.rendered&&this.autoScroll){
			var el=this.body||this.el;
			if(el){
				el.setOverflow('auto');
			}
		}
	},
	getKeyMap:function(){
		if(!this.keyMap){
			this.keyMap=new Ext.KeyMap(this.el,this.keys);
		}
		return this.keyMap;
	},
	initEvents:function(){
		if(this.keys){
			this.getKeyMap();
		}
		if(this.draggable){
			this.initDraggable();
		}
	},
	initDraggable:function(){
		this.dd=new Ext.Panel.DD(this,typeof this.draggable=='boolean'?null:this.draggable);
	},
	beforeEffect:function(){
		if(this.floating){
			this.el.beforeAction();
		}
		this.el.addClass('x-panel-animated');
	},
	afterEffect:function(){
		this.syncShadow();
		this.el.removeClass('x-panel-animated');
	},
	createEffect:function(a,cb,scope){
		var o={
			scope:scope,
			block:true
		};
		if(a===true){
			o.callback=cb;
			return o;
		}else if(!a.callback){
			o.callback=cb;
		}else{
			o.callback=function(){
				cb.call(scope);
				Ext.callback(a.callback,a.scope);
			};
		}
		return Ext.applyIf(o,a);
	},
	collapse:function(animate){
		if(this.collapsed||this.el.hasFxBlock()||this.fireEvent('beforecollapse',this,animate)===false){
			return;
		}
		var doAnim=animate===true||(animate!==false&&this.animCollapse);
		this.beforeEffect();
		this.onCollapse(doAnim,animate);
		return this;
	},
	onCollapse:function(doAnim,animArg){
		if(doAnim){
			this[this.collapseEl].slideOut(this.slideAnchor,
					Ext.apply(this.createEffect(animArg||true,this.afterCollapse,this),
						this.collapseDefaults));
		}else{
			this[this.collapseEl].hide();
			this.afterCollapse();
		}
	},
	afterCollapse:function(){
		this.collapsed=true;
		this.el.addClass(this.collapsedCls);
		this.afterEffect();
		this.fireEvent('collapse',this);
	},
	expand:function(animate){
		if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent('beforeexpand',this,animate)===false){
			return;
		}
		var doAnim=animate===true||(animate!==false&&this.animCollapse);
		this.el.removeClass(this.collapsedCls);
		this.beforeEffect();
		this.onExpand(doAnim,animate);
		return this;
	},
	onExpand:function(doAnim,animArg){
		if(doAnim){
			this[this.collapseEl].slideIn(this.slideAnchor,
					Ext.apply(this.createEffect(animArg||true,this.afterExpand,this),
						this.expandDefaults));
		}else{
			this[this.collapseEl].show();
			this.afterExpand();
		}
	},
	afterExpand:function(){
		this.collapsed=false;
		this.afterEffect();
		if(this.deferLayout!==undefined){
			this.doLayout(true);
		}
		this.fireEvent('expand',this);
	},
	toggleCollapse:function(animate){
		this[this.collapsed?'expand':'collapse'](animate);
		return this;
	},
	onDisable:function(){
		if(this.rendered&&this.maskDisabled){
			this.el.mask();
		}
		Ext.Panel.superclass.onDisable.call(this);
	},
	onEnable:function(){
		if(this.rendered&&this.maskDisabled){
			this.el.unmask();
		}
		Ext.Panel.superclass.onEnable.call(this);
	},
	onResize:function(w,h){
		if(w!==undefined||h!==undefined){
			if(!this.collapsed){
				if(typeof w=='number'){
					w=this.adjustBodyWidth(w-this.getFrameWidth());
					if(this.tbar){
						this.tbar.setWidth(w);
						if(this.topToolbar){
							this.topToolbar.setSize(w);
						}
					}
					if(this.bbar){
						this.bbar.setWidth(w);
						if(this.bottomToolbar){
							this.bottomToolbar.setSize(w);
						}
					}
					if(this.fbar){
						var f=this.fbar,
							fWidth=1,
							strict=Ext.isStrict;
						if(this.buttonAlign=='left'){
						 fWidth=w-f.container.getFrameWidth('lr');
						}else{
							if(Ext.isIE||Ext.isWebKit){
								if(!(this.buttonAlign=='center'&&Ext.isWebKit)&&(!strict||(!Ext.isIE8&&strict))){
									(function(){
										f.setWidth(f.getEl().child('.x-toolbar-ct').getWidth());
									}).defer(1);
								}else{
									fWidth='auto';
								}
							}else{
								fWidth='auto';
							}
						}
						f.setWidth(fWidth);
					}
					this.body.setWidth(w);
				}else if(w=='auto'){
					this.body.setWidth(w);
				}
				if(typeof h=='number'){
					h=Math.max(0,this.adjustBodyHeight(h-this.getFrameHeight()));
					this.body.setHeight(h);
				}else if(h=='auto'){
					this.body.setHeight(h);
				}
				if(this.disabled&&this.el._mask){
					this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight());
				}
			}else{
				this.queuedBodySize={width:w,height:h};
				if(!this.queuedExpand&&this.allowQueuedExpand!==false){
					this.queuedExpand=true;
					this.on('expand',function(){
						delete this.queuedExpand;
						this.onResize(this.queuedBodySize.width,this.queuedBodySize.height);
						this.doLayout();
					},this,{single:true});
				}
			}
			this.fireEvent('bodyresize',this,w,h);
		}
		this.syncShadow();
	},
	adjustBodyHeight:function(h){
		return h;
	},
	adjustBodyWidth:function(w){
		return w;
	},
	onPosition:function(){
		this.syncShadow();
	},
	getFrameWidth:function(){
		var w=this.el.getFrameWidth('lr')+this.bwrap.getFrameWidth('lr');
		if(this.frame){
			var l=this.bwrap.dom.firstChild;
			w+=(Ext.fly(l).getFrameWidth('l')+Ext.fly(l.firstChild).getFrameWidth('r'));
			var mc=this.bwrap.dom.firstChild.firstChild.firstChild;
			w+=Ext.fly(mc).getFrameWidth('lr');
		}
		return w;
	},
	getFrameHeight:function(){
		var h=this.el.getFrameWidth('tb')+this.bwrap.getFrameWidth('tb');
		h+=(this.tbar?this.tbar.getHeight():0)+
			(this.bbar?this.bbar.getHeight():0);
		if(this.frame){
			var hd=this.el.dom.firstChild;
			var ft=this.bwrap.dom.lastChild;
			h+=(hd.offsetHeight+ft.offsetHeight);
			var mc=this.bwrap.dom.firstChild.firstChild.firstChild;
			h+=Ext.fly(mc).getFrameWidth('tb');
		}else{
			h+=(this.header?this.header.getHeight():0)+
				(this.footer?this.footer.getHeight():0);
		}
		return h;
	},
	getInnerWidth:function(){
		return this.getSize().width-this.getFrameWidth();
	},
	getInnerHeight:function(){
		return this.getSize().height-this.getFrameHeight();
	},
	syncShadow:function(){
		if(this.floating){
			this.el.sync(true);
		}
	},
	getLayoutTarget:function(){
		return this.body;
	},
	setTitle:function(title,iconCls){
		this.title=title;
		if(this.header&&this.headerAsText){
			this.header.child('span').update(title);
		}
		if(iconCls){
			this.setIconClass(iconCls);
		}
		this.fireEvent('titlechange',this,title);
		return this;
	},
	getUpdater:function(){
		return this.body.getUpdater();
	},
	load:function(){
		var um=this.body.getUpdater();
		um.update.apply(um,arguments);
		return this;
	},
	beforeDestroy:function(){
		if(this.header){
			this.header.removeAllListeners();
			if(this.headerAsText){
				Ext.Element.uncache(this.header.child('span'));
			}
		}
		Ext.Element.uncache(
			this.header,
			this.tbar,
			this.bbar,
			this.footer,
			this.body,
			this.bwrap
		);
		if(this.tools){
			for(var k in this.tools){
				Ext.destroy(this.tools[k]);
			}
		}
		if(this.buttons){
			for(var b in this.buttons){
				Ext.destroy(this.buttons[b]);
			}
		}
		Ext.destroy(this.toolbars);
		Ext.Panel.superclass.beforeDestroy.call(this);
	},
	createClasses:function(){
		this.headerCls=this.baseCls+'-header';
		this.headerTextCls=this.baseCls+'-header-text';
		this.bwrapCls=this.baseCls+'-bwrap';
		this.tbarCls=this.baseCls+'-tbar';
		this.bodyCls=this.baseCls+'-body';
		this.bbarCls=this.baseCls+'-bbar';
		this.footerCls=this.baseCls+'-footer';
	},
	createGhost:function(cls,useShim,appendTo){
		var el=document.createElement('div');
		el.className='x-panel-ghost '+(cls?cls:'');
		if(this.header){
			el.appendChild(this.el.dom.firstChild.cloneNode(true));
		}
		Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight());
		el.style.width=this.el.dom.offsetWidth+'px';;
		if(!appendTo){
			this.container.dom.appendChild(el);
		}else{
			Ext.getDom(appendTo).appendChild(el);
		}
		if(useShim!==false&&this.el.useShim!==false){
			var layer=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},el);
			layer.show();
			return layer;
		}else{
			return new Ext.Element(el);
		}
	},
	doAutoLoad:function(){
		var u=this.body.getUpdater();
		if(this.renderer){
			u.setRenderer(this.renderer);
		}
		u.update(Ext.isObject(this.autoLoad)?this.autoLoad:{url:this.autoLoad});
	},
	getTool:function(id){
		return this.tools[id];
	}});
Ext.reg('panel',Ext.Panel);
Ext.Editor=function(field,config){
	if(field.field){
		this.field=Ext.create(field.field,'textfield');
		config=Ext.apply({},field);
		delete config.field;
	}else{
		this.field=field;
	}
	Ext.Editor.superclass.constructor.call(this,config);};
Ext.extend(Ext.Editor,Ext.Component,{
	value:"",
	alignment:"c-c?",
	shadow:"frame",
	constrain:false,
	swallowKeys:true,
	completeOnEnter:false,
	cancelOnEsc:false,
	updateEl:false,
	initComponent:function(){
		Ext.Editor.superclass.initComponent.call(this);
		this.addEvents(
			"beforestartedit",
			"startedit",
			"beforecomplete",
			"complete",
			"canceledit",
			"specialkey"
		);
	},
	onRender:function(ct,position){
		this.el=new Ext.Layer({
			shadow:this.shadow,
			cls:"x-editor",
			parentEl:ct,
			shim:this.shim,
			shadowOffset:this.shadowOffset||4,
			id:this.id,
			constrain:this.constrain
		});
		if(this.zIndex){
			this.el.setZIndex(this.zIndex);
		}
		this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");
		if(this.field.msgTarget!='title'){
			this.field.msgTarget='qtip';
		}
		this.field.inEditor=true;
		this.field.render(this.el);
		if(Ext.isGecko){
			this.field.el.dom.setAttribute('autocomplete','off');
		}
		this.mon(this.field,"specialkey",this.onSpecialKey,this);
		if(this.swallowKeys){
			this.field.el.swallowEvent(['keydown','keypress']);
		}
		this.field.show();
		this.mon(this.field,"blur",this.onBlur,this);
		if(this.field.grow){
			this.mon(this.field,"autosize",this.el.sync,this.el,{delay:1});
		}
	},
	onSpecialKey:function(field,e){
		var key=e.getKey();
		if(this.completeOnEnter&&key==e.ENTER){
			e.stopEvent();
			this.completeEdit();
		}else if(this.cancelOnEsc&&key==e.ESC){
			this.cancelEdit();
		}else{
			this.fireEvent('specialkey',field,e);
		}
		if(this.field.triggerBlur&&(key==e.ENTER||key==e.ESC||key==e.TAB)){
			this.field.triggerBlur();
		}
	},
	startEdit:function(el,value){
		if(this.editing){
			this.completeEdit();
		}
		this.boundEl=Ext.get(el);
		var v=value!==undefined?value:this.boundEl.dom.innerHTML;
		if(!this.rendered){
			this.render(this.parentEl||document.body);
		}
		if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){
			return;
		}
		this.startValue=v;
		this.field.setValue(v);
		this.doAutoSize();
		this.el.alignTo(this.boundEl,this.alignment);
		this.editing=true;
		this.show();
	},
	doAutoSize:function(){
		if(this.autoSize){
			var sz=this.boundEl.getSize();
			switch(this.autoSize){
				case"width":
					this.setSize(sz.width,"");
				break;
				case"height":
					this.setSize("",sz.height);
				break;
				default:
					this.setSize(sz.width,sz.height);
			}
		}
	},
	setSize:function(w,h){
		delete this.field.lastSize;
		this.field.setSize(w,h);
		if(this.el){
			if(Ext.isGecko2||Ext.isOpera){
				this.el.setSize(w,h);
			}
			this.el.sync();
		}
	},
	realign:function(){
		this.el.alignTo(this.boundEl,this.alignment);
	},
	completeEdit:function(remainVisible){
		if(!this.editing){
			return;
		}
		var v=this.getValue();
		if(!this.field.isValid()){
			if(this.revertInvalid!==false){
				this.cancelEdit(remainVisible);
			}
			return;
		}
		if(String(v)===String(this.startValue)&&this.ignoreNoChange){
			this.hideEdit(remainVisible);
			return;
		}
		if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){
			v=this.getValue();
			if(this.updateEl&&this.boundEl){
				this.boundEl.update(v);
			}
			this.hideEdit(remainVisible);
			this.fireEvent("complete",this,v,this.startValue);
		}
	},
	onShow:function(){
		this.el.show();
		if(this.hideEl!==false){
			this.boundEl.hide();
		}
		this.field.show();
		if(Ext.isIE&&!this.fixIEFocus){
			this.fixIEFocus=true;
			this.deferredFocus.defer(50,this);
		}else{
			this.field.focus();
		}
		this.fireEvent("startedit",this.boundEl,this.startValue);
	},
	deferredFocus:function(){
		if(this.editing){
			this.field.focus();
		}
	},
	cancelEdit:function(remainVisible){
		if(this.editing){
			var v=this.getValue();
			this.setValue(this.startValue);
			this.hideEdit(remainVisible);
			this.fireEvent("canceledit",this,v,this.startValue);
		}
	},
	hideEdit:function(remainVisible){
		if(remainVisible!==true){
			this.editing=false;
			this.hide();
		}
	},
	onBlur:function(){
		if(this.allowBlur!==true&&this.editing){
			this.completeEdit();
		}
	},
	onHide:function(){
		if(this.editing){
			this.completeEdit();
			return;
		}
		this.field.blur();
		if(this.field.collapse){
			this.field.collapse();
		}
		this.el.hide();
		if(this.hideEl!==false){
			this.boundEl.show();
		}
	},
	setValue:function(v){
		this.field.setValue(v);
	},
	getValue:function(){
		return this.field.getValue();
	},
	beforeDestroy:function(){
		Ext.destroy(this.field);
		this.field=null;
	}});
Ext.reg('editor',Ext.Editor);
Ext.ColorPalette=function(config){
	Ext.ColorPalette.superclass.constructor.call(this,config);
	this.addEvents(
		'select'
	);
	if(this.handler){
		this.on("select",this.handler,this.scope,true);
	}};
Ext.extend(Ext.ColorPalette,Ext.Component,{
	itemCls:"x-color-palette",
	value:null,
	clickEvent:'click',
	ctype:"Ext.ColorPalette",
	allowReselect:false,
	colors:[
		"000000","993300","333300","003300","003366","000080","333399","333333",
		"800000","FF6600","808000","008000","008080","0000FF","666699","808080",
		"FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696",
		"FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0",
		"FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"
	],
	onRender:function(container,position){
		var t=this.tpl||new Ext.XTemplate(
			'<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>'
		);
		var el=document.createElement("div");
		el.id=this.getId();
		el.className=this.itemCls;
		t.overwrite(el,this.colors);
		container.dom.insertBefore(el,position);
		this.el=Ext.get(el);
		this.mon(this.el,this.clickEvent,this.handleClick,this,{delegate:'a'});
		if(this.clickEvent!='click'){
			this.mon(this.el,'click',Ext.emptyFn,this,{delegate:'a',preventDefault:true});
		}
	},
	afterRender:function(){
		Ext.ColorPalette.superclass.afterRender.call(this);
		if(this.value){
			var s=this.value;
			this.value=null;
			this.select(s);
		}
	},
	handleClick:function(e,t){
		e.preventDefault();
		if(!this.disabled){
			var c=t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
			this.select(c.toUpperCase());
		}
	},
	select:function(color){
		color=color.replace("#","");
		if(color!=this.value||this.allowReselect){
			var el=this.el;
			if(this.value){
				el.child("a.color-"+this.value).removeClass("x-color-palette-sel");
			}
			el.child("a.color-"+color).addClass("x-color-palette-sel");
			this.value=color;
			this.fireEvent("select",this,color);
		}
	}
	});
Ext.reg('colorpalette',Ext.ColorPalette);
Ext.DatePicker=Ext.extend(Ext.BoxComponent,{
	todayText:'Today',
	okText:'&#160;OK&#160;',
	cancelText:'Cancel',
	todayTip:'{0} (Spacebar)',
	minText:'This date is before the minimum date',
	maxText:'This date is after the maximum date',
	format:'m/d/y',
	disabledDaysText:'Disabled',
	disabledDatesText:'Disabled',
	monthNames:Date.monthNames,
	dayNames:Date.dayNames,
	nextText:'Next Month (Control+Right)',
	prevText:'Previous Month (Control+Left)',
	monthYearText:'Choose a month (Control+Up/Down to move years)',
	startDay:0,
	showToday:true,
	initComponent:function(){
		Ext.DatePicker.superclass.initComponent.call(this);
		this.value=this.value?
				 this.value.clearTime():new Date().clearTime();
		this.addEvents(
			'select'
		);
		if(this.handler){
			this.on('select',this.handler,this.scope||this);
		}
		this.initDisabledDays();
	},
	initDisabledDays:function(){
		if(!this.disabledDatesRE&&this.disabledDates){
			var dd=this.disabledDates,
				len=dd.length-1,
				re='(?:';
			Ext.each(dd,function(d,i){
				re+=Ext.isDate(d)?'^'+Ext.escapeRe(d.dateFormat(this.format))+'$':dd[i];
				if(i!=len){
					re+='|';
				}
			},this);
			this.disabledDatesRE=new RegExp(re+')');
		}
	},
	setDisabledDates:function(dd){
		if(Ext.isArray(dd)){
			this.disabledDates=dd;
			this.disabledDatesRE=null;
		}else{
			this.disabledDatesRE=dd;
		}
		this.initDisabledDays();
		this.update(this.value,true);
	},
	setDisabledDays:function(dd){
		this.disabledDays=dd;
		this.update(this.value,true);
	},
	setMinDate:function(dt){
		this.minDate=dt;
		this.update(this.value,true);
	},
	setMaxDate:function(dt){
		this.maxDate=dt;
		this.update(this.value,true);
	},
	setValue:function(value){
		var old=this.value;
		this.value=value.clearTime(true);
		if(this.el){
			this.update(this.value);
		}
	},
	getValue:function(){
		return this.value;
	},
	focus:function(){
		if(this.el){
			this.update(this.activeDate);
		}
	},
	onEnable:function(initial){
		Ext.DatePicker.superclass.onEnable.call(this);
		this.doDisabled(false);
		this.update(initial?this.value:this.activeDate);
		if(Ext.isIE){
			this.el.repaint();
		}
	},
	onDisable:function(){
		Ext.DatePicker.superclass.onDisable.call(this);
		this.doDisabled(true);
		if(Ext.isIE&&!Ext.isIE8){
			 Ext.each([].concat(this.textNodes,this.el.query('th span')),function(el){
				 Ext.fly(el).repaint();
			});
		}
	},
	doDisabled:function(disabled){
		this.keyNav.setDisabled(disabled);
		this.prevRepeater.setDisabled(disabled);
		this.nextRepeater.setDisabled(disabled);
		if(this.showToday){
			this.todayKeyListener.setDisabled(disabled);
			this.todayBtn.setDisabled(disabled);
		}
	},
	onRender:function(container,position){
		var m=[
			'<table cellspacing="0">',
				'<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>',
				'<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],
				dn=this.dayNames,
				i;
		for(i=0;i<7;i++){
			var d=this.startDay+i;
			if(d>6){
				d=d-7;
			}
			m.push('<th><span>',dn[d].substr(0,1),'</span></th>');
		}
		m[m.length]='</tr></thead><tbody><tr>';
		for(i=0;i<42;i++){
			if(i%7===0&&i!==0){
				m[m.length]='</tr><tr>';
			}
			m[m.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>';
		}
		m.push('</tr></tbody></table></td></tr>',
				this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':'',
				'</table><div class="x-date-mp"></div>');
		var el=document.createElement('div');
		el.className='x-date-picker';
		el.innerHTML=m.join('');
		container.dom.insertBefore(el,position);
		this.el=Ext.get(el);
		this.eventEl=Ext.get(el.firstChild);
		this.prevRepeater=new Ext.util.ClickRepeater(this.el.child('td.x-date-left a'),{
			handler:this.showPrevMonth,
			scope:this,
			preventDefault:true,
			stopDefault:true
		});
		this.nextRepeater=new Ext.util.ClickRepeater(this.el.child('td.x-date-right a'),{
			handler:this.showNextMonth,
			scope:this,
			preventDefault:true,
			stopDefault:true
		});
		this.monthPicker=this.el.down('div.x-date-mp');
		this.monthPicker.enableDisplayMode('block');
		this.keyNav=new Ext.KeyNav(this.eventEl,{
			'left':function(e){
				if(e.ctrlKey){
					this.showPrevMonth();
				}else{
					this.update(this.activeDate.add('d',-1));
				}
			},
			'right':function(e){
				if(e.ctrlKey){
					this.showNextMonth();
				}else{
					this.update(this.activeDate.add('d',1));
				}
			},
			'up':function(e){
				if(e.ctrlKey){
					this.showNextYear();
				}else{
					this.update(this.activeDate.add('d',-7));
				}
			},
			'down':function(e){
				if(e.ctrlKey){
					this.showPrevYear();
				}else{
					this.update(this.activeDate.add('d',7));
				}
			},
			'pageUp':function(e){
				this.showNextMonth();
			},
			'pageDown':function(e){
				this.showPrevMonth();
			},
			'enter':function(e){
				e.stopPropagation();
				return true;
			},
			scope:this
		});
		this.el.unselectable();
		this.cells=this.el.select('table.x-date-inner tbody td');
		this.textNodes=this.el.query('table.x-date-inner tbody span');
		this.mbtn=new Ext.Button({
			text:'&#160;',
			tooltip:this.monthYearText,
			renderTo:this.el.child('td.x-date-middle',true)
		});
		this.mbtn.el.child('em').addClass('x-btn-arrow');
		if(this.showToday){
			this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);
			var today=(new Date()).dateFormat(this.format);
			this.todayBtn=new Ext.Button({
				renderTo:this.el.child('td.x-date-bottom',true),
				text:String.format(this.todayText,today),
				tooltip:String.format(this.todayTip,today),
				handler:this.selectToday,
				scope:this
			});
		}
		this.mon(this.eventEl,'mousewheel',this.handleMouseWheel,this);
		this.mon(this.eventEl,'click',this.handleDateClick,this,{delegate:'a.x-date-date'});
		this.mon(this.mbtn,'click',this.showMonthPicker,this);
		this.onEnable(true);
	},
	createMonthPicker:function(){
		if(!this.monthPicker.dom.firstChild){
			var buf=['<table border="0" cellspacing="0">'];
			for(var i=0;i<6;i++){
				buf.push(
					'<tr><td class="x-date-mp-month"><a href="#">',Date.getShortMonthName(i),'</a></td>',
					'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',Date.getShortMonthName(i+6),'</a></td>',
					i===0?
					'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':
					'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>'
				);
			}
			buf.push(
				'<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',
					this.okText,
					'</button><button type="button" class="x-date-mp-cancel">',
					this.cancelText,
					'</button></td></tr>',
				'</table>'
			);
			this.monthPicker.update(buf.join(''));
			this.mon(this.monthPicker,'click',this.onMonthClick,this);
			this.mon(this.monthPicker,'dblclick',this.onMonthDblClick,this);
			this.mpMonths=this.monthPicker.select('td.x-date-mp-month');
			this.mpYears=this.monthPicker.select('td.x-date-mp-year');
			this.mpMonths.each(function(m,a,i){
				i+=1;
				if((i%2)===0){
					m.dom.xmonth=5+Math.round(i*0.5);
				}else{
					m.dom.xmonth=Math.round((i-1)*0.5);
				}
			});
		}
	},
	showMonthPicker:function(){
		if(!this.disabled){
			this.createMonthPicker();
			var size=this.el.getSize();
			this.monthPicker.setSize(size);
			this.monthPicker.child('table').setSize(size);
			this.mpSelMonth=(this.activeDate||this.value).getMonth();
			this.updateMPMonth(this.mpSelMonth);
			this.mpSelYear=(this.activeDate||this.value).getFullYear();
			this.updateMPYear(this.mpSelYear);
			this.monthPicker.slideIn('t',{duration:0.2});
		}
	},
	updateMPYear:function(y){
		this.mpyear=y;
		var ys=this.mpYears.elements;
		for(var i=1;i<=10;i++){
			var td=ys[i-1],y2;
			if((i%2)===0){
				y2=y+Math.round(i*0.5);
				td.firstChild.innerHTML=y2;
				td.xyear=y2;
			}else{
				y2=y-(5-Math.round(i*0.5));
				td.firstChild.innerHTML=y2;
				td.xyear=y2;
			}
			this.mpYears.item(i-1)[y2==this.mpSelYear?'addClass':'removeClass']('x-date-mp-sel');
		}
	},
	updateMPMonth:function(sm){
		this.mpMonths.each(function(m,a,i){
			m[m.dom.xmonth==sm?'addClass':'removeClass']('x-date-mp-sel');
		});
	},
	selectMPMonth:function(m){
	},
	onMonthClick:function(e,t){
		e.stopEvent();
		var el=new Ext.Element(t),pn;
		if(el.is('button.x-date-mp-cancel')){
			this.hideMonthPicker();
		}
		else if(el.is('button.x-date-mp-ok')){
			var d=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());
			if(d.getMonth()!=this.mpSelMonth){
				d=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth();
			}
			this.update(d);
			this.hideMonthPicker();
		}
		else if((pn=el.up('td.x-date-mp-month',2))){
			this.mpMonths.removeClass('x-date-mp-sel');
			pn.addClass('x-date-mp-sel');
			this.mpSelMonth=pn.dom.xmonth;
		}
		else if((pn=el.up('td.x-date-mp-year',2))){
			this.mpYears.removeClass('x-date-mp-sel');
			pn.addClass('x-date-mp-sel');
			this.mpSelYear=pn.dom.xyear;
		}
		else if(el.is('a.x-date-mp-prev')){
			this.updateMPYear(this.mpyear-10);
		}
		else if(el.is('a.x-date-mp-next')){
			this.updateMPYear(this.mpyear+10);
		}
	},
	onMonthDblClick:function(e,t){
		e.stopEvent();
		var el=new Ext.Element(t),pn;
		if((pn=el.up('td.x-date-mp-month',2))){
			this.update(new Date(this.mpSelYear,pn.dom.xmonth,(this.activeDate||this.value).getDate()));
			this.hideMonthPicker();
		}
		else if((pn=el.up('td.x-date-mp-year',2))){
			this.update(new Date(pn.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));
			this.hideMonthPicker();
		}
	},
	hideMonthPicker:function(disableAnim){
		if(this.monthPicker){
			if(disableAnim===true){
				this.monthPicker.hide();
			}else{
				this.monthPicker.slideOut('t',{duration:0.2});
			}
		}
	},
	showPrevMonth:function(e){
		this.update(this.activeDate.add('mo',-1));
	},
	showNextMonth:function(e){
		this.update(this.activeDate.add('mo',1));
	},
	showPrevYear:function(){
		this.update(this.activeDate.add('y',-1));
	},
	showNextYear:function(){
		this.update(this.activeDate.add('y',1));
	},
	handleMouseWheel:function(e){
		e.stopEvent();
		if(!this.disabled){
			var delta=e.getWheelDelta();
			if(delta>0){
				this.showPrevMonth();
			}else if(delta<0){
				this.showNextMonth();
			}
		}
	},
	handleDateClick:function(e,t){
		e.stopEvent();
		if(!this.disabled&&t.dateValue&&!Ext.fly(t.parentNode).hasClass('x-date-disabled')){
			this.setValue(new Date(t.dateValue));
			this.fireEvent('select',this,this.value);
		}
	},
	selectToday:function(){
		if(this.todayBtn&&!this.todayBtn.disabled){
			this.setValue(new Date().clearTime());
			this.fireEvent('select',this,this.value);
		}
	},
	update:function(date,forceRefresh){
		var vd=this.activeDate,vis=this.isVisible();
		this.activeDate=date;
		if(!forceRefresh&&vd&&this.el){
			var t=date.getTime();
			if(vd.getMonth()==date.getMonth()&&vd.getFullYear()==date.getFullYear()){
				this.cells.removeClass('x-date-selected');
				this.cells.each(function(c){
				 if(c.dom.firstChild.dateValue==t){
					 c.addClass('x-date-selected');
					 if(vis){
						 Ext.fly(c.dom.firstChild).focus(50);
					}
					 return false;
				}
				});
				return;
			}
		}
		var days=date.getDaysInMonth();
		var firstOfMonth=date.getFirstDateOfMonth();
		var startingPos=firstOfMonth.getDay()-this.startDay;
		if(startingPos<=this.startDay){
			startingPos+=7;
		}
		var pm=date.add('mo',-1);
		var prevStart=pm.getDaysInMonth()-startingPos;
		var cells=this.cells.elements;
		var textEls=this.textNodes;
		days+=startingPos;
		var day=86400000;
		var d=(new Date(pm.getFullYear(),pm.getMonth(),prevStart)).clearTime();
		var today=new Date().clearTime().getTime();
		var sel=date.clearTime().getTime();
		var min=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;
		var max=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;
		var ddMatch=this.disabledDatesRE;
		var ddText=this.disabledDatesText;
		var ddays=this.disabledDays?this.disabledDays.join(''):false;
		var ddaysText=this.disabledDaysText;
		var format=this.format;
		if(this.showToday){
			var td=new Date().clearTime();
			var disable=(td<min||td>max||
				(ddMatch&&format&&ddMatch.test(td.dateFormat(format)))||
				(ddays&&ddays.indexOf(td.getDay())!=-1));
			if(!this.disabled){
				this.todayBtn.setDisabled(disable);
				this.todayKeyListener[disable?'disable':'enable']();
			}
		}
		var setCellClass=function(cal,cell){
			cell.title='';
			var t=d.getTime();
			cell.firstChild.dateValue=t;
			if(t==today){
				cell.className+=' x-date-today';
				cell.title=cal.todayText;
			}
			if(t==sel){
				cell.className+=' x-date-selected';
				if(vis){
					Ext.fly(cell.firstChild).focus(50);
				}
			}
			if(t<min){
				cell.className=' x-date-disabled';
				cell.title=cal.minText;
				return;
			}
			if(t>max){
				cell.className=' x-date-disabled';
				cell.title=cal.maxText;
				return;
			}
			if(ddays){
				if(ddays.indexOf(d.getDay())!=-1){
					cell.title=ddaysText;
					cell.className=' x-date-disabled';
				}
			}
			if(ddMatch&&format){
				var fvalue=d.dateFormat(format);
				if(ddMatch.test(fvalue)){
					cell.title=ddText.replace('%0',fvalue);
					cell.className=' x-date-disabled';
				}
			}
		};
		var i=0;
		for(;i<startingPos;i++){
			textEls[i].innerHTML=(++prevStart);
			d.setDate(d.getDate()+1);
			cells[i].className='x-date-prevday';
			setCellClass(this,cells[i]);
		}
		for(;i<days;i++){
			var intDay=i-startingPos+1;
			textEls[i].innerHTML=(intDay);
			d.setDate(d.getDate()+1);
			cells[i].className='x-date-active';
			setCellClass(this,cells[i]);
		}
		var extraDays=0;
		for(;i<42;i++){
			 textEls[i].innerHTML=(++extraDays);
			 d.setDate(d.getDate()+1);
			 cells[i].className='x-date-nextday';
			 setCellClass(this,cells[i]);
		}
		this.mbtn.setText(this.monthNames[date.getMonth()]+' '+date.getFullYear());
		if(!this.internalRender){
			var main=this.el.dom.firstChild;
			var w=main.offsetWidth;
			this.el.setWidth(w+this.el.getBorderWidth('lr'));
			Ext.fly(main).setWidth(w);
			this.internalRender=true;
			if(Ext.isOpera&&!this.secondPass){
				main.rows[0].cells[1].style.width=(w-(main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth))+'px';
				this.secondPass=true;
				this.update.defer(10,this,[date]);
			}
		}
	},
	beforeDestroy:function(){
		if(this.rendered){
			this.keyNav.disable();
			this.keyNav=null;
			Ext.destroy(
				this.leftClickRpt,
				this.rightClickRpt,
				this.monthPicker,
				this.eventEl,
				this.mbtn,
				this.todayBtn
			);
		}
	}
	});
Ext.reg('datepicker',Ext.DatePicker);
Ext.LoadMask=function(el,config){
	this.el=Ext.get(el);
	Ext.apply(this,config);
	if(this.store){
		this.store.on('beforeload',this.onBeforeLoad,this);
		this.store.on('load',this.onLoad,this);
		this.store.on('exception',this.onLoad,this);
		this.removeMask=Ext.value(this.removeMask,false);
	}else{
		var um=this.el.getUpdater();
		um.showLoadIndicator=false;
		um.on('beforeupdate',this.onBeforeLoad,this);
		um.on('update',this.onLoad,this);
		um.on('failure',this.onLoad,this);
		this.removeMask=Ext.value(this.removeMask,true);
	}};
Ext.LoadMask.prototype={
	msg:'Loading...',
	msgCls:'x-mask-loading',
	disabled:false,
	disable:function(){
	 this.disabled=true;
	},
	enable:function(){
		this.disabled=false;
	},
	onLoad:function(){
		this.el.unmask(this.removeMask);
	},
	onBeforeLoad:function(){
		if(!this.disabled){
			this.el.mask(this.msg,this.msgCls);
		}
	},
	show:function(){
		this.onBeforeLoad();
	},
	hide:function(){
		this.onLoad();
	},
	destroy:function(){
		if(this.store){
			this.store.un('beforeload',this.onBeforeLoad,this);
			this.store.un('load',this.onLoad,this);
			this.store.un('exception',this.onLoad,this);
		}else{
			var um=this.el.getUpdater();
			um.un('beforeupdate',this.onBeforeLoad,this);
			um.un('update',this.onLoad,this);
			um.un('failure',this.onLoad,this);
		}
	}};
Ext.Slider=Ext.extend(Ext.BoxComponent,{
	vertical:false,
	minValue:0,
	maxValue:100,
	decimalPrecision:0,
	keyIncrement:1,
	increment:0,
	clickRange:[5,15],
	clickToChange:true,
	animate:true,
	dragging:false,
	initComponent:function(){
		if(!Ext.isDefined(this.value)){
			this.value=this.minValue;
		}
		Ext.Slider.superclass.initComponent.call(this);
		this.keyIncrement=Math.max(this.increment,this.keyIncrement);
		this.addEvents(
			'beforechange',
			'change',
			'changecomplete',
			'dragstart',
			'drag',
			'dragend'
		);
		if(this.vertical){
			Ext.apply(this,Ext.Slider.Vertical);
		}
	},
	onRender:function(){
		this.autoEl={
			cls:'x-slider '+(this.vertical?'x-slider-vert':'x-slider-horz'),
			cn:{cls:'x-slider-end',cn:{cls:'x-slider-inner',cn:[{cls:'x-slider-thumb'},{tag:'a',cls:'x-slider-focus',href:"#",tabIndex:'-1',hidefocus:'on'}]}}
		};
		Ext.Slider.superclass.onRender.apply(this,arguments);
		this.endEl=this.el.first();
		this.innerEl=this.endEl.first();
		this.thumb=this.innerEl.first();
		this.halfThumb=(this.vertical?this.thumb.getHeight():this.thumb.getWidth())/2;
		this.focusEl=this.thumb.next();
		this.initEvents();
	},
	initEvents:function(){
		this.thumb.addClassOnOver('x-slider-thumb-over');
		this.mon(this.el,{
			scope:this,
			mousedown:this.onMouseDown,
			keydown:this.onKeyDown
		});
		this.focusEl.swallowEvent("click",true);
		this.tracker=new Ext.dd.DragTracker({
			onBeforeStart:this.onBeforeDragStart.createDelegate(this),
			onStart:this.onDragStart.createDelegate(this),
			onDrag:this.onDrag.createDelegate(this),
			onEnd:this.onDragEnd.createDelegate(this),
			tolerance:3,
			autoStart:300
		});
		this.tracker.initEl(this.thumb);
		this.on('beforedestroy',this.tracker.destroy,this.tracker);
	},
	onMouseDown:function(e){
		if(this.disabled){return;}
		if(this.clickToChange&&e.target!=this.thumb.dom){
			var local=this.innerEl.translatePoints(e.getXY());
			this.onClickChange(local);
		}
		this.focus();
	},
	onClickChange:function(local){
		if(local.top>this.clickRange[0]&&local.top<this.clickRange[1]){
			this.setValue(Ext.util.Format.round(this.reverseValue(local.left),this.decimalPrecision),undefined,true);
		}
	},
	onKeyDown:function(e){
		if(this.disabled){e.preventDefault();return;}
		var k=e.getKey();
		switch(k){
			case e.UP:
			case e.RIGHT:
				e.stopEvent();
				if(e.ctrlKey){
					this.setValue(this.maxValue,undefined,true);
				}else{
					this.setValue(this.value+this.keyIncrement,undefined,true);
				}
			break;
			case e.DOWN:
			case e.LEFT:
				e.stopEvent();
				if(e.ctrlKey){
					this.setValue(this.minValue,undefined,true);
				}else{
					this.setValue(this.value-this.keyIncrement,undefined,true);
				}
			break;
			default:
				e.preventDefault();
		}
	},
	doSnap:function(value){
		if(!this.increment||this.increment==1||!value){
			return value;
		}
		var newValue=value,inc=this.increment;
		var m=value%inc;
		if(m!=0){
			newValue-=m;
			if(m*2>inc){
				newValue+=inc;
			}else if(m*2<-inc){
				newValue-=inc;
			}
		}
		return newValue.constrain(this.minValue,this.maxValue);
	},
	afterRender:function(){
		Ext.Slider.superclass.afterRender.apply(this,arguments);
		if(this.value!==undefined){
			var v=this.normalizeValue(this.value);
			if(v!==this.value){
				delete this.value;
				this.setValue(v,false);
			}else{
				this.moveThumb(this.translateValue(v),false);
			}
		}
	},
	getRatio:function(){
		var w=this.innerEl.getWidth();
		var v=this.maxValue-this.minValue;
		return v==0?w:(w/v);
	},
	normalizeValue:function(v){
		v=this.doSnap(v);
		v=Ext.util.Format.round(v,this.decimalPrecision);
		v=v.constrain(this.minValue,this.maxValue);
		return v;
	},
	setValue:function(v,animate,changeComplete){
		v=this.normalizeValue(v);
		if(v!==this.value&&this.fireEvent('beforechange',this,v,this.value)!==false){
			this.value=v;
			this.moveThumb(this.translateValue(v),animate!==false);
			this.fireEvent('change',this,v);
			if(changeComplete){
				this.fireEvent('changecomplete',this,v);
			}
		}
	},
	translateValue:function(v){
		var ratio=this.getRatio();
		return(v*ratio)-(this.minValue*ratio)-this.halfThumb;
	},
	reverseValue:function(pos){
		var ratio=this.getRatio();
		return(pos+this.halfThumb+(this.minValue*ratio))/ratio;
	},
	moveThumb:function(v,animate){
		if(!animate||this.animate===false){
			this.thumb.setLeft(v);
		}else{
			this.thumb.shift({left:v,stopFx:true,duration:.35});
		}
	},
	focus:function(){
		this.focusEl.focus(10);
	},
	onBeforeDragStart:function(e){
		return!this.disabled;
	},
	onDragStart:function(e){
		this.thumb.addClass('x-slider-thumb-drag');
		this.dragging=true;
		this.dragStartValue=this.value;
		this.fireEvent('dragstart',this,e);
	},
	onDrag:function(e){
		var pos=this.innerEl.translatePoints(this.tracker.getXY());
		this.setValue(Ext.util.Format.round(this.reverseValue(pos.left),this.decimalPrecision),false);
		this.fireEvent('drag',this,e);
	},
	onDragEnd:function(e){
		this.thumb.removeClass('x-slider-thumb-drag');
		this.dragging=false;
		this.fireEvent('dragend',this,e);
		if(this.dragStartValue!=this.value){
			this.fireEvent('changecomplete',this,this.value);
		}
	},
	onResize:function(w,h){
		this.innerEl.setWidth(w-(this.el.getPadding('l')+this.endEl.getPadding('r')));
		this.syncThumb();
	},
	onDisable:function(){
		Ext.Slider.superclass.onDisable.call(this);
		this.thumb.addClass(this.disabledClass);
		if(Ext.isIE){
			var xy=this.thumb.getXY();
			this.thumb.hide();
			this.innerEl.addClass(this.disabledClass).dom.disabled=true;
			if(!this.thumbHolder){
				this.thumbHolder=this.endEl.createChild({cls:'x-slider-thumb '+this.disabledClass});
			}
			this.thumbHolder.show().setXY(xy);
		}
	},
	onEnable:function(){
		Ext.Slider.superclass.onEnable.call(this);
		this.thumb.removeClass(this.disabledClass);
		if(Ext.isIE){
			this.innerEl.removeClass(this.disabledClass).dom.disabled=false;
			if(this.thumbHolder){
				this.thumbHolder.hide();
			}
			this.thumb.show();
			this.syncThumb();
		}
	},
	syncThumb:function(){
		if(this.rendered){
			this.moveThumb(this.translateValue(this.value));
		}
	},
	getValue:function(){
		return this.value;
	}});
Ext.reg('slider',Ext.Slider);
Ext.Slider.Vertical={
	onResize:function(w,h){
		this.innerEl.setHeight(h-(this.el.getPadding('t')+this.endEl.getPadding('b')));
		this.syncThumb();
	},
	getRatio:function(){
		var h=this.innerEl.getHeight();
		var v=this.maxValue-this.minValue;
		return h/v;
	},
	moveThumb:function(v,animate){
		if(!animate||this.animate===false){
			this.thumb.setBottom(v);
		}else{
			this.thumb.shift({bottom:v,stopFx:true,duration:.35});
		}
	},
	onDrag:function(e){
		var pos=this.innerEl.translatePoints(this.tracker.getXY());
		var bottom=this.innerEl.getHeight()-pos.top;
		this.setValue(this.minValue+Ext.util.Format.round(bottom/this.getRatio(),this.decimalPrecision),false);
		this.fireEvent('drag',this,e);
	},
	onClickChange:function(local){
		if(local.left>this.clickRange[0]&&local.left<this.clickRange[1]){
			var bottom=this.innerEl.getHeight()-local.top;
			this.setValue(this.minValue+Ext.util.Format.round(bottom/this.getRatio(),this.decimalPrecision),undefined,true);
		}
	}};
Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{
	baseCls:'x-progress',
	animate:false,
	waitTimer:null,
	initComponent:function(){
		Ext.ProgressBar.superclass.initComponent.call(this);
		this.addEvents(
			"update"
		);
	},
	onRender:function(ct,position){
		var tpl=new Ext.Template(
			'<div class="{cls}-wrap">',
				'<div class="{cls}-inner">',
					'<div class="{cls}-bar">',
						'<div class="{cls}-text">',
							'<div>&#160;</div>',
						'</div>',
					'</div>',
					'<div class="{cls}-text {cls}-text-back">',
						'<div>&#160;</div>',
					'</div>',
				'</div>',
			'</div>'
		);
		this.el=position?tpl.insertBefore(position,{cls:this.baseCls},true)
			:tpl.append(ct,{cls:this.baseCls},true);
		if(this.id){
			this.el.dom.id=this.id;
		}
		var inner=this.el.dom.firstChild;
		this.progressBar=Ext.get(inner.firstChild);
		if(this.textEl){
			this.textEl=Ext.get(this.textEl);
			delete this.textTopEl;
		}else{
			this.textTopEl=Ext.get(this.progressBar.dom.firstChild);
			var textBackEl=Ext.get(inner.childNodes[1]);
			this.textTopEl.setStyle("z-index",99).addClass('x-hidden');
			this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,textBackEl.dom.firstChild]);
			this.textEl.setWidth(inner.offsetWidth);
		}
		this.progressBar.setHeight(inner.offsetHeight);
	},
	afterRender:function(){
		Ext.ProgressBar.superclass.afterRender.call(this);
		if(this.value){
			this.updateProgress(this.value,this.text);
		}else{
			this.updateText(this.text);
		}
	},
	updateProgress:function(value,text,animate){
		this.value=value||0;
		if(text){
			this.updateText(text);
		}
		if(this.rendered){
			var w=Math.floor(value*this.el.dom.firstChild.offsetWidth);
			this.progressBar.setWidth(w,animate===true||(animate!==false&&this.animate));
			if(this.textTopEl){
				this.textTopEl.removeClass('x-hidden').setWidth(w);
			}
		}
		this.fireEvent('update',this,value,text);
		return this;
	},
	wait:function(o){
		if(!this.waitTimer){
			var scope=this;
			o=o||{};
			this.updateText(o.text);
			this.waitTimer=Ext.TaskMgr.start({
				run:function(i){
					var inc=o.increment||10;
					this.updateProgress(((((i+inc)%inc)+1)*(100/inc))*0.01,null,o.animate);
				},
				interval:o.interval||1000,
				duration:o.duration,
				onStop:function(){
					if(o.fn){
						o.fn.apply(o.scope||this);
					}
					this.reset();
				},
				scope:scope
			});
		}
		return this;
	},
	isWaiting:function(){
		return this.waitTimer!==null;
	},
	updateText:function(text){
		this.text=text||'&#160;';
		if(this.rendered){
			this.textEl.update(this.text);
		}
		return this;
	},
	syncProgressBar:function(){
		if(this.value){
			this.updateProgress(this.value,this.text);
		}
		return this;
	},
	setSize:function(w,h){
		Ext.ProgressBar.superclass.setSize.call(this,w,h);
		if(this.textTopEl){
			var inner=this.el.dom.firstChild;
			this.textEl.setSize(inner.offsetWidth,inner.offsetHeight);
		}
		this.syncProgressBar();
		return this;
	},
	reset:function(hide){
		this.updateProgress(0);
		if(this.textTopEl){
			this.textTopEl.addClass('x-hidden');
		}
		if(this.waitTimer){
			this.waitTimer.onStop=null;
			Ext.TaskMgr.stop(this.waitTimer);
			this.waitTimer=null;
		}
		if(hide===true){
			this.hide();
		}
		return this;
	}});
Ext.reg('progress',Ext.ProgressBar);
(function(){
var Event=Ext.EventManager;
var Dom=Ext.lib.Dom;
Ext.dd.DragDrop=function(id,sGroup,config){
	if(id){
		this.init(id,sGroup,config);
	}};
Ext.dd.DragDrop.prototype={
	id:null,
	config:null,
	dragElId:null,
	handleElId:null,
	invalidHandleTypes:null,
	invalidHandleIds:null,
	invalidHandleClasses:null,
	startPageX:0,
	startPageY:0,
	groups:null,
	locked:false,
	lock:function(){this.locked=true;},
	moveOnly:false,
	unlock:function(){this.locked=false;},
	isTarget:true,
	padding:null,
	_domRef:null,
	__ygDragDrop:true,
	constrainX:false,
	constrainY:false,
	minX:0,
	maxX:0,
	minY:0,
	maxY:0,
	maintainOffset:false,
	xTicks:null,
	yTicks:null,
	primaryButtonOnly:true,
	available:false,
	hasOuterHandles:false,
	b4StartDrag:function(x,y){},
	startDrag:function(x,y){},
	b4Drag:function(e){},
	onDrag:function(e){},
	onDragEnter:function(e,id){},
	b4DragOver:function(e){},
	onDragOver:function(e,id){},
	b4DragOut:function(e){},
	onDragOut:function(e,id){},
	b4DragDrop:function(e){},
	onDragDrop:function(e,id){},
	onInvalidDrop:function(e){},
	b4EndDrag:function(e){},
	endDrag:function(e){},
	b4MouseDown:function(e){},
	onMouseDown:function(e){},
	onMouseUp:function(e){},
	onAvailable:function(){
	},
	defaultPadding:{left:0,right:0,top:0,bottom:0},
	constrainTo:function(constrainTo,pad,inContent){
		if(typeof pad=="number"){
			pad={left:pad,right:pad,top:pad,bottom:pad};
		}
		pad=pad||this.defaultPadding;
		var b=Ext.get(this.getEl()).getBox();
		var ce=Ext.get(constrainTo);
		var s=ce.getScroll();
		var c,cd=ce.dom;
		if(cd==document.body){
			c={x:s.left,y:s.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()};
		}else{
			var xy=ce.getXY();
			c={x:xy[0]+s.left,y:xy[1]+s.top,width:cd.clientWidth,height:cd.clientHeight};
		}
		var topSpace=b.y-c.y;
		var leftSpace=b.x-c.x;
		this.resetConstraints();
		this.setXConstraint(leftSpace-(pad.left||0),
				c.width-leftSpace-b.width-(pad.right||0),
				this.xTickSize
		);
		this.setYConstraint(topSpace-(pad.top||0),
				c.height-topSpace-b.height-(pad.bottom||0),
				this.yTickSize
		);
	},
	getEl:function(){
		if(!this._domRef){
			this._domRef=Ext.getDom(this.id);
		}
		return this._domRef;
	},
	getDragEl:function(){
		return Ext.getDom(this.dragElId);
	},
	init:function(id,sGroup,config){
		this.initTarget(id,sGroup,config);
		Event.on(this.id,"mousedown",this.handleMouseDown,this);
	},
	initTarget:function(id,sGroup,config){
		this.config=config||{};
		this.DDM=Ext.dd.DDM;
		this.groups={};
		if(typeof id!=="string"){
			id=Ext.id(id);
		}
		this.id=id;
		this.addToGroup((sGroup)?sGroup:"default");
		this.handleElId=id;
		this.setDragElId(id);
		this.invalidHandleTypes={A:"A"};
		this.invalidHandleIds={};
		this.invalidHandleClasses=[];
		this.applyConfig();
		this.handleOnAvailable();
	},
	applyConfig:function(){
		this.padding		=this.config.padding||[0,0,0,0];
		this.isTarget		=(this.config.isTarget!==false);
		this.maintainOffset	=(this.config.maintainOffset);
		this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);
	},
	handleOnAvailable:function(){
		this.available=true;
		this.resetConstraints();
		this.onAvailable();
	},
	setPadding:function(iTop,iRight,iBot,iLeft){
		if(!iRight&&0!==iRight){
			this.padding=[iTop,iTop,iTop,iTop];
		}else if(!iBot&&0!==iBot){
			this.padding=[iTop,iRight,iTop,iRight];
		}else{
			this.padding=[iTop,iRight,iBot,iLeft];
		}
	},
	setInitPosition:function(diffX,diffY){
		var el=this.getEl();
		if(!this.DDM.verifyEl(el)){
			return;
		}
		var dx=diffX||0;
		var dy=diffY||0;
		var p=Dom.getXY(el);
		this.initPageX=p[0]-dx;
		this.initPageY=p[1]-dy;
		this.lastPageX=p[0];
		this.lastPageY=p[1];
		this.setStartPosition(p);
	},
	setStartPosition:function(pos){
		var p=pos||Dom.getXY(this.getEl());
		this.deltaSetXY=null;
		this.startPageX=p[0];
		this.startPageY=p[1];
	},
	addToGroup:function(sGroup){
		this.groups[sGroup]=true;
		this.DDM.regDragDrop(this,sGroup);
	},
	removeFromGroup:function(sGroup){
		if(this.groups[sGroup]){
			delete this.groups[sGroup];
		}
		this.DDM.removeDDFromGroup(this,sGroup);
	},
	setDragElId:function(id){
		this.dragElId=id;
	},
	setHandleElId:function(id){
		if(typeof id!=="string"){
			id=Ext.id(id);
		}
		this.handleElId=id;
		this.DDM.regHandle(this.id,id);
	},
	setOuterHandleElId:function(id){
		if(typeof id!=="string"){
			id=Ext.id(id);
		}
		Event.on(id,"mousedown",
				this.handleMouseDown,this);
		this.setHandleElId(id);
		this.hasOuterHandles=true;
	},
	unreg:function(){
		Event.un(this.id,"mousedown",
				this.handleMouseDown);
		this._domRef=null;
		this.DDM._remove(this);
	},
	destroy:function(){
		this.unreg();
	},
	isLocked:function(){
		return(this.DDM.isLocked()||this.locked);
	},
	handleMouseDown:function(e,oDD){
		if(this.primaryButtonOnly&&e.button!=0){
			return;
		}
		if(this.isLocked()){
			return;
		}
		this.DDM.refreshCache(this.groups);
		var pt=new Ext.lib.Point(Ext.lib.Event.getPageX(e),Ext.lib.Event.getPageY(e));
		if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){
		}else{
			if(this.clickValidator(e)){
				this.setStartPosition();
				this.b4MouseDown(e);
				this.onMouseDown(e);
				this.DDM.handleMouseDown(e,this);
				this.DDM.stopEvent(e);
			}else{
			}
		}
	},
	clickValidator:function(e){
		var target=e.getTarget();
		return(this.isValidHandleChild(target)&&
					(this.id==this.handleElId||
						this.DDM.handleWasClicked(target,this.id)));
	},
	addInvalidHandleType:function(tagName){
		var type=tagName.toUpperCase();
		this.invalidHandleTypes[type]=type;
	},
	addInvalidHandleId:function(id){
		if(typeof id!=="string"){
			id=Ext.id(id);
		}
		this.invalidHandleIds[id]=id;
	},
	addInvalidHandleClass:function(cssClass){
		this.invalidHandleClasses.push(cssClass);
	},
	removeInvalidHandleType:function(tagName){
		var type=tagName.toUpperCase();
		delete this.invalidHandleTypes[type];
	},
	removeInvalidHandleId:function(id){
		if(typeof id!=="string"){
			id=Ext.id(id);
		}
		delete this.invalidHandleIds[id];
	},
	removeInvalidHandleClass:function(cssClass){
		for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){
			if(this.invalidHandleClasses[i]==cssClass){
				delete this.invalidHandleClasses[i];
			}
		}
	},
	isValidHandleChild:function(node){
		var valid=true;
		var nodeName;
		try{
			nodeName=node.nodeName.toUpperCase();
		}catch(e){
			nodeName=node.nodeName;
		}
		valid=valid&&!this.invalidHandleTypes[nodeName];
		valid=valid&&!this.invalidHandleIds[node.id];
		for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){
			valid=!Ext.fly(node).hasClass(this.invalidHandleClasses[i]);
		}
		return valid;
	},
	setXTicks:function(iStartX,iTickSize){
		this.xTicks=[];
		this.xTickSize=iTickSize;
		var tickMap={};
		for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){
			if(!tickMap[i]){
				this.xTicks[this.xTicks.length]=i;
				tickMap[i]=true;
			}
		}
		for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){
			if(!tickMap[i]){
				this.xTicks[this.xTicks.length]=i;
				tickMap[i]=true;
			}
		}
		this.xTicks.sort(this.DDM.numericSort);
	},
	setYTicks:function(iStartY,iTickSize){
		this.yTicks=[];
		this.yTickSize=iTickSize;
		var tickMap={};
		for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){
			if(!tickMap[i]){
				this.yTicks[this.yTicks.length]=i;
				tickMap[i]=true;
			}
		}
		for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){
			if(!tickMap[i]){
				this.yTicks[this.yTicks.length]=i;
				tickMap[i]=true;
			}
		}
		this.yTicks.sort(this.DDM.numericSort);
	},
	setXConstraint:function(iLeft,iRight,iTickSize){
		this.leftConstraint=iLeft;
		this.rightConstraint=iRight;
		this.minX=this.initPageX-iLeft;
		this.maxX=this.initPageX+iRight;
		if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
		this.constrainX=true;
	},
	clearConstraints:function(){
		this.constrainX=false;
		this.constrainY=false;
		this.clearTicks();
	},
	clearTicks:function(){
		this.xTicks=null;
		this.yTicks=null;
		this.xTickSize=0;
		this.yTickSize=0;
	},
	setYConstraint:function(iUp,iDown,iTickSize){
		this.topConstraint=iUp;
		this.bottomConstraint=iDown;
		this.minY=this.initPageY-iUp;
		this.maxY=this.initPageY+iDown;
		if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
		this.constrainY=true;
	},
	resetConstraints:function(){
		if(this.initPageX||this.initPageX===0){
			var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;
			var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;
			this.setInitPosition(dx,dy);
		}else{
			this.setInitPosition();
		}
		if(this.constrainX){
			this.setXConstraint(this.leftConstraint,
								 this.rightConstraint,
								 this.xTickSize		);
		}
		if(this.constrainY){
			this.setYConstraint(this.topConstraint,
								 this.bottomConstraint,
								 this.yTickSize		);
		}
	},
	getTick:function(val,tickArray){
		if(!tickArray){
			return val;
		}else if(tickArray[0]>=val){
			return tickArray[0];
		}else{
			for(var i=0,len=tickArray.length;i<len;++i){
				var next=i+1;
				if(tickArray[next]&&tickArray[next]>=val){
					var diff1=val-tickArray[i];
					var diff2=tickArray[next]-val;
					return(diff2>diff1)?tickArray[i]:tickArray[next];
				}
			}
			return tickArray[tickArray.length-1];
		}
	},
	toString:function(){
		return("DragDrop "+this.id);
	}};})();
if(!Ext.dd.DragDropMgr){
Ext.dd.DragDropMgr=function(){
	var Event=Ext.EventManager;
	return{
		ids:{},
		handleIds:{},
		dragCurrent:null,
		dragOvers:{},
		deltaX:0,
		deltaY:0,
		preventDefault:true,
		stopPropagation:true,
		initialized:false,
		locked:false,
		init:function(){
			this.initialized=true;
		},
		POINT:0,
		INTERSECT:1,
		mode:0,
		_execOnAll:function(sMethod,args){
			for(var i in this.ids){
				for(var j in this.ids[i]){
					var oDD=this.ids[i][j];
					if(!this.isTypeOfDD(oDD)){
						continue;
					}
					oDD[sMethod].apply(oDD,args);
				}
			}
		},
		_onLoad:function(){
			this.init();
			Event.on(document,"mouseup",this.handleMouseUp,this,true);
			Event.on(document,"mousemove",this.handleMouseMove,this,true);
			Event.on(window,"unload",	this._onUnload,this,true);
			Event.on(window,"resize",	this._onResize,this,true);
		},
		_onResize:function(e){
			this._execOnAll("resetConstraints",[]);
		},
		lock:function(){this.locked=true;},
		unlock:function(){this.locked=false;},
		isLocked:function(){return this.locked;},
		locationCache:{},
		useCache:true,
		clickPixelThresh:3,
		clickTimeThresh:350,
		dragThreshMet:false,
		clickTimeout:null,
		startX:0,
		startY:0,
		regDragDrop:function(oDD,sGroup){
			if(!this.initialized){this.init();}
			if(!this.ids[sGroup]){
				this.ids[sGroup]={};
			}
			this.ids[sGroup][oDD.id]=oDD;
		},
		removeDDFromGroup:function(oDD,sGroup){
			if(!this.ids[sGroup]){
				this.ids[sGroup]={};
			}
			var obj=this.ids[sGroup];
			if(obj&&obj[oDD.id]){
				delete obj[oDD.id];
			}
		},
		_remove:function(oDD){
			for(var g in oDD.groups){
				if(g&&this.ids[g]&&this.ids[g][oDD.id]){
					delete this.ids[g][oDD.id];
				}
			}
			delete this.handleIds[oDD.id];
		},
		regHandle:function(sDDId,sHandleId){
			if(!this.handleIds[sDDId]){
				this.handleIds[sDDId]={};
			}
			this.handleIds[sDDId][sHandleId]=sHandleId;
		},
		isDragDrop:function(id){
			return(this.getDDById(id))?true:false;
		},
		getRelated:function(p_oDD,bTargetsOnly){
			var oDDs=[];
			for(var i in p_oDD.groups){
				for(var j in this.ids[i]){
					var dd=this.ids[i][j];
					if(!this.isTypeOfDD(dd)){
						continue;
					}
					if(!bTargetsOnly||dd.isTarget){
						oDDs[oDDs.length]=dd;
					}
				}
			}
			return oDDs;
		},
		isLegalTarget:function(oDD,oTargetDD){
			var targets=this.getRelated(oDD,true);
			for(var i=0,len=targets.length;i<len;++i){
				if(targets[i].id==oTargetDD.id){
					return true;
				}
			}
			return false;
		},
		isTypeOfDD:function(oDD){
			return(oDD&&oDD.__ygDragDrop);
		},
		isHandle:function(sDDId,sHandleId){
			return(this.handleIds[sDDId]&&
							this.handleIds[sDDId][sHandleId]);
		},
		getDDById:function(id){
			for(var i in this.ids){
				if(this.ids[i][id]){
					return this.ids[i][id];
				}
			}
			return null;
		},
		handleMouseDown:function(e,oDD){
			if(Ext.QuickTips){
				Ext.QuickTips.disable();
			}
			if(this.dragCurrent){
				this.handleMouseUp(e);
			}
			this.currentTarget=e.getTarget();
			this.dragCurrent=oDD;
			var el=oDD.getEl();
			this.startX=e.getPageX();
			this.startY=e.getPageY();
			this.deltaX=this.startX-el.offsetLeft;
			this.deltaY=this.startY-el.offsetTop;
			this.dragThreshMet=false;
			this.clickTimeout=setTimeout(
					function(){
						var DDM=Ext.dd.DDM;
						DDM.startDrag(DDM.startX,DDM.startY);
					},
					this.clickTimeThresh);
		},
		startDrag:function(x,y){
			clearTimeout(this.clickTimeout);
			if(this.dragCurrent){
				this.dragCurrent.b4StartDrag(x,y);
				this.dragCurrent.startDrag(x,y);
			}
			this.dragThreshMet=true;
		},
		handleMouseUp:function(e){
			if(Ext.QuickTips){
				Ext.QuickTips.enable();
			}
			if(!this.dragCurrent){
				return;
			}
			clearTimeout(this.clickTimeout);
			if(this.dragThreshMet){
				this.fireEvents(e,true);
			}else{
			}
			this.stopDrag(e);
			this.stopEvent(e);
		},
		stopEvent:function(e){
			if(this.stopPropagation){
				e.stopPropagation();
			}
			if(this.preventDefault){
				e.preventDefault();
			}
		},
		stopDrag:function(e){
			if(this.dragCurrent){
				if(this.dragThreshMet){
					this.dragCurrent.b4EndDrag(e);
					this.dragCurrent.endDrag(e);
				}
				this.dragCurrent.onMouseUp(e);
			}
			this.dragCurrent=null;
			this.dragOvers={};
		},
		handleMouseMove:function(e){
			if(!this.dragCurrent){
				return true;
			}
			if(Ext.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){
				this.stopEvent(e);
				return this.handleMouseUp(e);
			}
			if(!this.dragThreshMet){
				var diffX=Math.abs(this.startX-e.getPageX());
				var diffY=Math.abs(this.startY-e.getPageY());
				if(diffX>this.clickPixelThresh||
							diffY>this.clickPixelThresh){
					this.startDrag(this.startX,this.startY);
				}
			}
			if(this.dragThreshMet){
				this.dragCurrent.b4Drag(e);
				this.dragCurrent.onDrag(e);
				if(!this.dragCurrent.moveOnly){
					this.fireEvents(e,false);
				}
			}
			this.stopEvent(e);
			return true;
		},
		fireEvents:function(e,isDrop){
			var dc=this.dragCurrent;
			if(!dc||dc.isLocked()){
				return;
			}
			var pt=e.getPoint();
			var oldOvers=[];
			var outEvts=[];
			var overEvts=[];
			var dropEvts=[];
			var enterEvts=[];
			for(var i in this.dragOvers){
				var ddo=this.dragOvers[i];
				if(!this.isTypeOfDD(ddo)){
					continue;
				}
				if(!this.isOverTarget(pt,ddo,this.mode)){
					outEvts.push(ddo);
				}
				oldOvers[i]=true;
				delete this.dragOvers[i];
			}
			for(var sGroup in dc.groups){
				if("string"!=typeof sGroup){
					continue;
				}
				for(i in this.ids[sGroup]){
					var oDD=this.ids[sGroup][i];
					if(!this.isTypeOfDD(oDD)){
						continue;
					}
					if(oDD.isTarget&&!oDD.isLocked()&&((oDD!=dc)||(dc.ignoreSelf===false))){
						if(this.isOverTarget(pt,oDD,this.mode)){
							if(isDrop){
								dropEvts.push(oDD);
							}else{
								if(!oldOvers[oDD.id]){
									enterEvts.push(oDD);
								}else{
									overEvts.push(oDD);
								}
								this.dragOvers[oDD.id]=oDD;
							}
						}
					}
				}
			}
			if(this.mode){
				if(outEvts.length){
					dc.b4DragOut(e,outEvts);
					dc.onDragOut(e,outEvts);
				}
				if(enterEvts.length){
					dc.onDragEnter(e,enterEvts);
				}
				if(overEvts.length){
					dc.b4DragOver(e,overEvts);
					dc.onDragOver(e,overEvts);
				}
				if(dropEvts.length){
					dc.b4DragDrop(e,dropEvts);
					dc.onDragDrop(e,dropEvts);
				}
			}else{
				var len=0;
				for(i=0,len=outEvts.length;i<len;++i){
					dc.b4DragOut(e,outEvts[i].id);
					dc.onDragOut(e,outEvts[i].id);
				}
				for(i=0,len=enterEvts.length;i<len;++i){
					dc.onDragEnter(e,enterEvts[i].id);
				}
				for(i=0,len=overEvts.length;i<len;++i){
					dc.b4DragOver(e,overEvts[i].id);
					dc.onDragOver(e,overEvts[i].id);
				}
				for(i=0,len=dropEvts.length;i<len;++i){
					dc.b4DragDrop(e,dropEvts[i].id);
					dc.onDragDrop(e,dropEvts[i].id);
				}
			}
			if(isDrop&&!dropEvts.length){
				dc.onInvalidDrop(e);
			}
		},
		getBestMatch:function(dds){
			var winner=null;
			var len=dds.length;
			if(len==1){
				winner=dds[0];
			}else{
				for(var i=0;i<len;++i){
					var dd=dds[i];
					if(dd.cursorIsOver){
						winner=dd;
						break;
					}else{
						if(!winner||
							winner.overlap.getArea()<dd.overlap.getArea()){
							winner=dd;
						}
					}
				}
			}
			return winner;
		},
		refreshCache:function(groups){
			for(var sGroup in groups){
				if("string"!=typeof sGroup){
					continue;
				}
				for(var i in this.ids[sGroup]){
					var oDD=this.ids[sGroup][i];
					if(this.isTypeOfDD(oDD)){
						var loc=this.getLocation(oDD);
						if(loc){
							this.locationCache[oDD.id]=loc;
						}else{
							delete this.locationCache[oDD.id];
						}
					}
				}
			}
		},
		verifyEl:function(el){
			if(el){
				var parent;
				if(Ext.isIE){
					try{
						parent=el.offsetParent;
					}catch(e){}
				}else{
					parent=el.offsetParent;
				}
				if(parent){
					return true;
				}
			}
			return false;
		},
		getLocation:function(oDD){
			if(!this.isTypeOfDD(oDD)){
				return null;
			}
			var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;
			try{
				pos=Ext.lib.Dom.getXY(el);
			}catch(e){}
			if(!pos){
				return null;
			}
			x1=pos[0];
			x2=x1+el.offsetWidth;
			y1=pos[1];
			y2=y1+el.offsetHeight;
			t=y1-oDD.padding[0];
			r=x2+oDD.padding[1];
			b=y2+oDD.padding[2];
			l=x1-oDD.padding[3];
			return new Ext.lib.Region(t,r,b,l);
		},
		isOverTarget:function(pt,oTarget,intersect){
			var loc=this.locationCache[oTarget.id];
			if(!loc||!this.useCache){
				loc=this.getLocation(oTarget);
				this.locationCache[oTarget.id]=loc;
			}
			if(!loc){
				return false;
			}
			oTarget.cursorIsOver=loc.contains(pt);
			var dc=this.dragCurrent;
			if(!dc||!dc.getTargetCoord||
					(!intersect&&!dc.constrainX&&!dc.constrainY)){
				return oTarget.cursorIsOver;
			}
			oTarget.overlap=null;
			var pos=dc.getTargetCoord(pt.x,pt.y);
			var el=dc.getDragEl();
			var curRegion=new Ext.lib.Region(pos.y,
												 pos.x+el.offsetWidth,
												 pos.y+el.offsetHeight,
												 pos.x);
			var overlap=curRegion.intersect(loc);
			if(overlap){
				oTarget.overlap=overlap;
				return(intersect)?true:oTarget.cursorIsOver;
			}else{
				return false;
			}
		},
		_onUnload:function(e,me){
			Ext.dd.DragDropMgr.unregAll();
		},
		unregAll:function(){
			if(this.dragCurrent){
				this.stopDrag();
				this.dragCurrent=null;
			}
			this._execOnAll("unreg",[]);
			for(var i in this.elementCache){
				delete this.elementCache[i];
			}
			this.elementCache={};
			this.ids={};
		},
		elementCache:{},
		getElWrapper:function(id){
			var oWrapper=this.elementCache[id];
			if(!oWrapper||!oWrapper.el){
				oWrapper=this.elementCache[id]=
					new this.ElementWrapper(Ext.getDom(id));
			}
			return oWrapper;
		},
		getElement:function(id){
			return Ext.getDom(id);
		},
		getCss:function(id){
			var el=Ext.getDom(id);
			return(el)?el.style:null;
		},
		ElementWrapper:function(el){
				this.el=el||null;
				this.id=this.el&&el.id;
				this.css=this.el&&el.style;
			},
		getPosX:function(el){
			return Ext.lib.Dom.getX(el);
		},
		getPosY:function(el){
			return Ext.lib.Dom.getY(el);
		},
		swapNode:function(n1,n2){
			if(n1.swapNode){
				n1.swapNode(n2);
			}else{
				var p=n2.parentNode;
				var s=n2.nextSibling;
				if(s==n1){
					p.insertBefore(n1,n2);
				}else if(n2==n1.nextSibling){
					p.insertBefore(n2,n1);
				}else{
					n1.parentNode.replaceChild(n2,n1);
					p.insertBefore(n1,s);
				}
			}
		},
		getScroll:function(){
			var t,l,dde=document.documentElement,db=document.body;
			if(dde&&(dde.scrollTop||dde.scrollLeft)){
				t=dde.scrollTop;
				l=dde.scrollLeft;
			}else if(db){
				t=db.scrollTop;
				l=db.scrollLeft;
			}else{
			}
			return{top:t,left:l};
		},
		getStyle:function(el,styleProp){
			return Ext.fly(el).getStyle(styleProp);
		},
		getScrollTop:function(){return this.getScroll().top;},
		getScrollLeft:function(){return this.getScroll().left;},
		moveToEl:function(moveEl,targetEl){
			var aCoord=Ext.lib.Dom.getXY(targetEl);
			Ext.lib.Dom.setXY(moveEl,aCoord);
		},
		numericSort:function(a,b){return(a-b);},
		_timeoutCount:0,
		_addListeners:function(){
			var DDM=Ext.dd.DDM;
			if(Ext.lib.Event&&document){
				DDM._onLoad();
			}else{
				if(DDM._timeoutCount>2000){
				}else{
					setTimeout(DDM._addListeners,10);
					if(document&&document.body){
						DDM._timeoutCount+=1;
					}
				}
			}
		},
		handleWasClicked:function(node,id){
			if(this.isHandle(id,node.id)){
				return true;
			}else{
				var p=node.parentNode;
				while(p){
					if(this.isHandle(id,p.id)){
						return true;
					}else{
						p=p.parentNode;
					}
				}
			}
			return false;
		}
	};}();
Ext.dd.DDM=Ext.dd.DragDropMgr;
Ext.dd.DDM._addListeners();}